Tileset dialog for Tilorswift and fix for adding rows.

This commit is contained in:
Mal
2020-02-14 00:12:24 +01:00
parent 72589544bd
commit 04c3d0253b
19 changed files with 297 additions and 52 deletions

View File

@@ -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);
}
);
}