implement settings and controls screen

This commit is contained in:
LabyStudio
2022-02-05 16:58:30 +01:00
parent 52427e610d
commit e1c5ccfa89
10 changed files with 108 additions and 14 deletions
@@ -0,0 +1,21 @@
window.GuiKeyButton = class extends GuiButton {
constructor(name, key, x, y, width, height, callback) {
super(name + ": " + key, x, y, width, height, _ => callback(this.key));
this.listening = false;
}
onPress() {
this.listening = true;
this.string = "...";
}
keyTyped(key) {
if (this.listening) {
this.string = name + ": " + key;
this.listening = false;
this.key = key;
this.callback();
}
}
}