Fix rotating actors in the editor
This commit is contained in:
parent
6e7790efa6
commit
e8d3adfe8e
@ -683,8 +683,6 @@ const EDITOR_TOOLS = [{
|
|||||||
}];
|
}];
|
||||||
// Tiles the "adjust" tool will turn into each other
|
// Tiles the "adjust" tool will turn into each other
|
||||||
const EDITOR_ADJUST_TOGGLES = {
|
const EDITOR_ADJUST_TOGGLES = {
|
||||||
floor: 'wall',
|
|
||||||
wall: 'floor',
|
|
||||||
floor_custom_green: 'wall_custom_green',
|
floor_custom_green: 'wall_custom_green',
|
||||||
floor_custom_pink: 'wall_custom_pink',
|
floor_custom_pink: 'wall_custom_pink',
|
||||||
floor_custom_yellow: 'wall_custom_yellow',
|
floor_custom_yellow: 'wall_custom_yellow',
|
||||||
@ -795,7 +793,7 @@ class Editor extends PrimaryView {
|
|||||||
|
|
||||||
// Rotate actors
|
// Rotate actors
|
||||||
if (TILE_TYPES[tile.name].is_actor) {
|
if (TILE_TYPES[tile.name].is_actor) {
|
||||||
tile.direction = DIRECTIONS[tile.direction].right;
|
tile.direction = DIRECTIONS[tile.direction ?? 'south'].right;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -96,6 +96,7 @@ export class CanvasRenderer {
|
|||||||
for (let tile of this.level.cells[y][x]) {
|
for (let tile of this.level.cells[y][x]) {
|
||||||
let type;
|
let type;
|
||||||
if (tile.name) {
|
if (tile.name) {
|
||||||
|
// FIXME editor hack
|
||||||
type = TILE_TYPES[tile.name];
|
type = TILE_TYPES[tile.name];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -106,7 +107,8 @@ export class CanvasRenderer {
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (! tile.type) {
|
if (! tile.type) {
|
||||||
this.tileset.draw_type(tile.name, null, this.level, ctx, x - x0, y - y0);
|
// FIXME not a real tile, really not ideal, editor hack
|
||||||
|
this.tileset.draw_type(tile.name, tile, this.level, ctx, x - x0, y - y0);
|
||||||
}
|
}
|
||||||
else if (type.is_actor) {
|
else if (type.is_actor) {
|
||||||
// Handle smooth scrolling
|
// Handle smooth scrolling
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user