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

23 lines
710 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.001);
this.createButton('Abbrechen');
this.buttonOk = this.createButton('OK');
this.buttonOk.addEventListener(
'click',
() => {
window.dispatchEvent(
new TilorswiftGravityUpdatedEvent(parseFloat(this.inputGravity.value))
);
}
)
}
}