mr-crocs-adventures/tilorswift/js/dialog/DialogGravity.js

22 lines
708 B
JavaScript
Raw Normal View History

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