mirror of
https://git.leinelab.org/Mal/mr-crocs-adventures.git
synced 2025-09-11 02:57:36 +02:00
Tileset dialog for Tilorswift and fix for adding rows.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import Dialog from "./Dialog.js";
|
||||
import TilorswiftNewTerrainEvent from "../events/TilorswiftNewTerrainEvent.js";
|
||||
import Setting from "../../../js/Setting.js";
|
||||
import TilorswiftEvent from "../events/TilorswiftEvent.js";
|
||||
|
||||
export default class DialogNewTerrain extends Dialog
|
||||
{
|
||||
@@ -9,19 +9,29 @@ export default class DialogNewTerrain extends Dialog
|
||||
this.setMessage('Neues Terrain erstellen');
|
||||
this.inputRows = this.createInputNumber('Zeilen');
|
||||
this.inputColumns = this.createInputNumber('Spalten');
|
||||
this.inputTerrain = this.createTilesetSelector();
|
||||
this.buttonCancel = this.createButton('Abbrechen');
|
||||
this.buttonCreate = this.createButton('Erstellen');
|
||||
this.terrainIndex = 0;
|
||||
|
||||
this.buttonCreate.addEventListener(
|
||||
'click',
|
||||
() => {
|
||||
window.dispatchEvent(
|
||||
new TilorswiftNewTerrainEvent(
|
||||
Setting.TILESET_LOCATION + 'landscape01.jpg', /* TODO */
|
||||
this.terrainIndex,
|
||||
this.inputColumns.value,
|
||||
this.inputRows.value
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
window.addEventListener(
|
||||
TilorswiftEvent.TILESET_SELECTED,
|
||||
(event) => {
|
||||
this.terrainIndex = event.tilesetIndex;
|
||||
console.log(event.tilesetIndex);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user