From b855b65675a7ede1487019997e4f6278156095c7 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 19 Oct 2019 00:12:39 +0200 Subject: [PATCH] fix press E in driving and planeschool --- ReallifeGamemode.Client/util/drivingschool.ts | 12 ++++++------ ReallifeGamemode.Client/util/planeschool.ts | 13 +++++++------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/ReallifeGamemode.Client/util/drivingschool.ts b/ReallifeGamemode.Client/util/drivingschool.ts index 2a7ace68..f94e316b 100644 --- a/ReallifeGamemode.Client/util/drivingschool.ts +++ b/ReallifeGamemode.Client/util/drivingschool.ts @@ -33,15 +33,15 @@ export default function drivingSchoolHandle(globalData: GlobalData) { keyBound = true; }); - mp.events.add('removeDrivingSchoolMenu', (unbind) => { + mp.events.add('removeDrivingSchoolMenu', () => { mp.game.ui.clearHelp(true); - mp.gui.chat.show(true); + if (mainMenu != null) { + mainMenu.Close(); + } - if (keyBound && unbind) { - if (mainMenu) mainMenu.Close(); - - mp.keys.unbind(0x45, false, keyPressHandler); + if (keyBound) { keyBound = false; + mp.keys.unbind(0x45, false, keyPressHandler); } }); diff --git a/ReallifeGamemode.Client/util/planeschool.ts b/ReallifeGamemode.Client/util/planeschool.ts index cbbfb43d..706f57e8 100644 --- a/ReallifeGamemode.Client/util/planeschool.ts +++ b/ReallifeGamemode.Client/util/planeschool.ts @@ -33,15 +33,16 @@ export default function planeSchoolHandle(globalData: GlobalData) { keyBound = true; }); - mp.events.add('removeplaneSchoolMenu', (unbind) => { + mp.events.add('removeplaneSchoolMenu', () => { + mp.game.ui.clearHelp(true); - mp.gui.chat.show(true); + if (mainMenu != null) { + mainMenu.Close(); + } - if (keyBound && unbind) { - if (mainMenu) mainMenu.Close(); - - mp.keys.unbind(0x45, false, keyPressHandler); + if (keyBound) { keyBound = false; + mp.keys.unbind(0x45, false, keyPressHandler); } });