...................

This commit is contained in:
hydrant
2020-07-30 22:09:28 +02:00
parent ca5bf2ce55
commit 02ec46864e
2 changed files with 17 additions and 7 deletions

View File

@@ -40,8 +40,6 @@ mp.game.vehicle.defaultEngineBehaviour = false;
require('./Gui/house');
InputHelper.startDisableTimer();
import vehicleEntering from './vehiclesync/entering';
vehicleEntering(globalData);

View File

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