!!!!!!!!!!!!
This commit is contained in:
@@ -40,6 +40,8 @@ mp.game.vehicle.defaultEngineBehaviour = false;
|
|||||||
|
|
||||||
require('./Gui/house');
|
require('./Gui/house');
|
||||||
|
|
||||||
|
InputHelper.startDisableTimer();
|
||||||
|
|
||||||
import vehicleEntering from './vehiclesync/entering';
|
import vehicleEntering from './vehiclesync/entering';
|
||||||
vehicleEntering(globalData);
|
vehicleEntering(globalData);
|
||||||
|
|
||||||
@@ -231,6 +233,7 @@ import relativeVector from './util/relativevector';
|
|||||||
relativeVector();
|
relativeVector();
|
||||||
|
|
||||||
import bankMenuHandle from './Interaction/bankmenu';
|
import bankMenuHandle from './Interaction/bankmenu';
|
||||||
|
import InputHelper from './inputhelper';
|
||||||
bankMenuHandle(globalData);
|
bankMenuHandle(globalData);
|
||||||
|
|
||||||
require('./Gui/policedepartment');
|
require('./Gui/policedepartment');
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ export default class InputHelper {
|
|||||||
private browser: BrowserMp;
|
private browser: BrowserMp;
|
||||||
private data: IGlobalData;
|
private data: IGlobalData;
|
||||||
|
|
||||||
|
static active: 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;
|
||||||
@@ -25,17 +27,23 @@ export default class InputHelper {
|
|||||||
this.value = undefined;
|
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() {
|
private disableControls() {
|
||||||
//for (var x = 0; x < 358; x++) {
|
//for (var x = 0; x < 358; x++) {
|
||||||
// mp.game.controls.disableControlAction(1, x, true);
|
// 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() {
|
show() {
|
||||||
@@ -43,17 +51,14 @@ export default class InputHelper {
|
|||||||
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;
|
||||||
game.ui.sendChatMessage("registering render event");
|
|
||||||
|
|
||||||
mp.events.add('render', this.disableControls);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private finish() {
|
private finish() {
|
||||||
if (this.browser) {
|
if (this.browser) {
|
||||||
mp.events.remove('cef_inputhelper_sendvalue');
|
mp.events.remove('cef_inputhelper_sendvalue');
|
||||||
mp.events.remove('cef_request_title');
|
mp.events.remove('cef_request_title');
|
||||||
mp.events.remove('render', this.disableControls);
|
InputHelper.active = false;
|
||||||
this.browser.destroy();
|
this.browser.destroy();
|
||||||
this.data.InInput = false;
|
this.data.InInput = false;
|
||||||
this.created = false;
|
this.created = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user