!!!!!!!!!!!!

This commit is contained in:
hydrant
2020-07-30 22:03:55 +02:00
parent b03c0f7ea5
commit ca5bf2ce55
2 changed files with 18 additions and 10 deletions

View File

@@ -40,6 +40,8 @@ mp.game.vehicle.defaultEngineBehaviour = false;
require('./Gui/house');
InputHelper.startDisableTimer();
import vehicleEntering from './vehiclesync/entering';
vehicleEntering(globalData);
@@ -231,6 +233,7 @@ import relativeVector from './util/relativevector';
relativeVector();
import bankMenuHandle from './Interaction/bankmenu';
import InputHelper from './inputhelper';
bankMenuHandle(globalData);
require('./Gui/policedepartment');

View File

@@ -7,6 +7,8 @@ export default class InputHelper {
private browser: BrowserMp;
private data: IGlobalData;
static active: boolean = false;
constructor(title: string, globalData?: IGlobalData) {
this.title = title;
this.data = globalData || GlobalData;
@@ -25,17 +27,23 @@ export default class InputHelper {
this.value = undefined;
}
static 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);
})
}
private disableControls() {
//for (var x = 0; x < 358; x++) {
// mp.game.controls.disableControlAction(1, x, true);
//}
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);
}
show() {
@@ -43,17 +51,14 @@ export default class InputHelper {
this.data.InInput = true;
this.created = true;
this.browser = mp.browsers.new('package://assets/html/inputhelper/index.html');
game.ui.sendChatMessage("registering render event");
mp.events.add('render', this.disableControls);
InputHelper.active = true;
}
private finish() {
if (this.browser) {
mp.events.remove('cef_inputhelper_sendvalue');
mp.events.remove('cef_request_title');
mp.events.remove('render', this.disableControls);
InputHelper.active = false;
this.browser.destroy();
this.data.InInput = false;
this.created = false;