27 lines
934 B
JavaScript
27 lines
934 B
JavaScript
|
import Dialog from "./Dialog.js";
|
||
|
import TilorswiftNewTerrainEvent from "../events/TilorswiftNewTerrainEvent.js";
|
||
|
|
||
|
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(
|
||
|
'/mr-crocs-adventures/graphics/tileset-landscape01.jpg', /* TODO */
|
||
|
this.inputColumns.value,
|
||
|
this.inputRows.value
|
||
|
)
|
||
|
)
|
||
|
}
|
||
|
);
|
||
|
}
|
||
|
}
|