diff --git a/Client/Tuning/main.js b/Client/Tuning/main.js index ffb3a710..0538b80c 100644 --- a/Client/Tuning/main.js +++ b/Client/Tuning/main.js @@ -50,11 +50,11 @@ mp.events.add('showTuningInfo', () => { keyBound = true; }); -mp.events.add('hideTuningInfo', () => { +mp.events.add('hideTuningInfo', (unbind) => { mp.game.ui.clearHelp(true); mp.gui.chat.show(true); - if (keyBound) { + if (keyBound && unbind) { mp.keys.unbind(0x45, false, keyPressHandler); keyBound = false; } @@ -65,7 +65,7 @@ function keyPressHandler() { } mp.events.add("showTuningMenu", () => { - mp.events.call("hideTuningInfo"); + mp.events.call("hideTuningInfo" , false); mp.gui.chat.show(false); var localPlayer = mp.players.local; @@ -116,6 +116,10 @@ mp.events.add("showTuningMenu", () => { modMenu.Visible = true; }); + mainMenu.MenuClose.on(() => { + mp.events.call("hideTuningInfo", false); + }); + }); function getSlotName(slot) { diff --git a/Server/Managers/TuningManager.cs b/Server/Managers/TuningManager.cs index fe4befa3..f2c73e73 100644 --- a/Server/Managers/TuningManager.cs +++ b/Server/Managers/TuningManager.cs @@ -1,9 +1,5 @@ using GTANetworkAPI; -using reallife_gamemode.Server.Util; -using System; using System.Collections.Generic; -using System.Linq; -using System.Text; namespace reallife_gamemode.Server.Managers { @@ -13,11 +9,6 @@ namespace reallife_gamemode.Server.Managers public static void AddTuningGarage(Vector3 pos1, Vector3 pos2) { - // DEBUG - - NAPI.TextLabel.CreateTextLabel("Pos1", pos1, 100, 1, 0, new Color(255, 255, 255), true, 0); - NAPI.TextLabel.CreateTextLabel("Pos2", pos2, 100, 1, 0, new Color(255, 255, 255), true, 0); - ColShape colShape = NAPI.ColShape.CreateSphereColShape(pos1, 10, 0); colShape.OnEntityEnterColShape += (cs, c) => @@ -30,7 +21,7 @@ namespace reallife_gamemode.Server.Managers colShape.OnEntityExitColShape += (cs, c) => { - c.TriggerEvent("hideTuningInfo"); + c.TriggerEvent("hideTuningInfo", true); }; tuningGarages.Add(colShape);