2020-02-10 19:36:46 +01:00
|
|
|
import Dialog from "./Dialog.js";
|
|
|
|
import TilorswiftNewTerrainEvent from "../events/TilorswiftNewTerrainEvent.js";
|
2020-02-12 21:29:06 +01:00
|
|
|
import Setting from "../../../js/Setting.js";
|
2020-02-10 19:36:46 +01:00
|
|
|
|
|
|
|
export default class DialogNewTerrain extends Dialog
|
|
|
|
{
|
|
|
|
constructor() {
|
|
|
|
super();
|
|
|
|
this.setMessage('Neues Terrain erstellen');
|
|
|
|
this.inputRows = this.createInputNumber('Zeilen');
|
|
|
|
this.inputColumns = this.createInputNumber('Spalten');
|
|
|
|
this.buttonCancel = this.createButton('Abbrechen');
|
|
|
|
this.buttonCreate = this.createButton('Erstellen');
|
|
|
|
|
|
|
|
this.buttonCreate.addEventListener(
|
|
|
|
'click',
|
|
|
|
() => {
|
|
|
|
window.dispatchEvent(
|
|
|
|
new TilorswiftNewTerrainEvent(
|
2020-02-12 21:29:06 +01:00
|
|
|
Setting.TILESET_LOCATION + 'landscape01.jpg', /* TODO */
|
2020-02-10 19:36:46 +01:00
|
|
|
this.inputColumns.value,
|
|
|
|
this.inputRows.value
|
|
|
|
)
|
|
|
|
)
|
|
|
|
}
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|