mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Menu bar for brush selection implemented.
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import Field from "./Field.js";
|
||||
import Tileset from "./Tileset.js";
|
||||
import TilorswiftEvent from "./events/TilorswiftEvent.js";
|
||||
|
||||
export default class Terrain
|
||||
{
|
||||
@@ -37,6 +38,13 @@ export default class Terrain
|
||||
this.fields.push(row);
|
||||
this.htmlElement.appendChild(tr);
|
||||
}
|
||||
|
||||
window.addEventListener(
|
||||
TilorswiftEvent.BUTTON_TILE_CLICKED,
|
||||
(event) => {
|
||||
this.brushTileIndex = event.button.index;
|
||||
}
|
||||
)
|
||||
}
|
||||
|
||||
getElement()
|
||||
@@ -44,6 +52,11 @@ export default class Terrain
|
||||
return this.htmlElement;
|
||||
}
|
||||
|
||||
getTileset()
|
||||
{
|
||||
return this.tileset;
|
||||
}
|
||||
|
||||
setFieldIndex(x, y, index)
|
||||
{
|
||||
this.fields[y][x].setIndex(index);
|
||||
|
||||
Reference in New Issue
Block a user