This commit is contained in:
hydrant
2020-07-30 22:21:34 +02:00
parent dd4d3a5b9e
commit ca93f27914

View File

@@ -7,10 +7,6 @@ export default class InputHelper {
private browser: BrowserMp; private browser: BrowserMp;
private data: IGlobalData; private data: IGlobalData;
static active: boolean = false;
static timerStarted: boolean = false;
constructor(title: string, globalData?: IGlobalData) { constructor(title: string, globalData?: IGlobalData) {
this.title = title; this.title = title;
this.data = globalData || GlobalData; this.data = globalData || GlobalData;
@@ -29,34 +25,13 @@ export default class InputHelper {
this.value = undefined; this.value = undefined;
} }
startDisableTimer(): void {
//mp.gui.chat.push("RENDER REGISTRIEREN");
mp.events.add("render", () => {
//game.ui.sendChatMessage("render in inputhelper - state = " + InputHelper.active);
if (InputHelper.active) {
mp.game.controls.disableAllControlActions(0);
mp.game.controls.disableAllControlActions(1);
mp.game.controls.disableAllControlActions(2);
mp.game.controls.disableAllControlActions(27);
}
})
}
show() { show() {
if (this.created) return; if (this.created) return;
if (!InputHelper.timerStarted) {
InputHelper.timerStarted = true;
this.startDisableTimer();
}
this.data.InMenu = true; this.data.InMenu = true;
this.data.InInput = true; this.data.InInput = true;
this.created = true; this.created = true;
this.browser = mp.browsers.new('package://assets/html/inputhelper/index.html'); this.browser = mp.browsers.new('package://assets/html/inputhelper/index.html');
InputHelper.active = true;
} }
private finish() { private finish() {