22 lines
708 B
JavaScript
22 lines
708 B
JavaScript
|
import Dialog from "./Dialog.js";
|
||
|
import TilorswiftGravityUpdatedEvent from "../events/TilorswiftGravityUpdatedEvent.js";
|
||
|
|
||
|
export default class DialogGravity extends Dialog
|
||
|
{
|
||
|
constructor(gravity)
|
||
|
{
|
||
|
super();
|
||
|
this.setMessage('Gravitation einstellen');
|
||
|
this.inputGravity = this.createInputNumber('Stärke', gravity, 0, 10, 0.01);
|
||
|
this.createButton('Abbrechen');
|
||
|
this.buttonOk = this.createButton('OK');
|
||
|
this.buttonOk.addEventListener(
|
||
|
'click',
|
||
|
() => {
|
||
|
window.dispatchEvent(
|
||
|
new TilorswiftGravityUpdatedEvent(parseFloat(this.inputGravity.value))
|
||
|
);
|
||
|
}
|
||
|
)
|
||
|
}
|
||
|
}
|