-
-
Notifications
You must be signed in to change notification settings - Fork 733
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(esx_menu_default/client/main.lua): Change isControlePress to ESX.RegisterInput #601
Conversation
Good job, nice optimization @AstroNext |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good, please take a look at the comments.
@@ -12,6 +13,7 @@ local function openMenu(namespace, name, data) | |||
end | |||
|
|||
local function closeMenu(namespace, name) | |||
CurrentNameSpace = namespace |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want to set this to nil or is it supposed to have the previous namespace?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I supposed to have the previous namespace.
That's on validate for menu submit.
but now can be nil
AddEventHandler('onResourceStop', function(resource) | ||
if GetCurrentResourceName() == resource and OpenedMenus > 0 then | ||
ESX.UI.Menu.CloseAll() | ||
elseif CurrentNameSpace ~= nil and CurrentNameSpace == resource and OpenedMenus > 0 then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If CurrentNameSpace does not equal resource it will also automatically mean that it is not nil, so the first check can be removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most resources use GetCurrentResourceName() for name space.
I will check this error handler with this native
First check can be removed but use to be more safe if menu stocked
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I test native that's return me es_extended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AstroNext I tested and works, really good job.
@Gittified What do you think about this?
Unsure if this is needed as esx menu default will be removed soon. |
@AstroNext @Gittified I re test and works perfectly thank you for help. |
commit fffe62c Merge: 3589976 b7e5351 Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Wed Jan 18 14:16:02 2023 +0100 Merge pull request #838 from Rav3n95/develop refactor(esx_banking) commit 3589976 Merge: b09776b 1d06e24 Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Wed Jan 18 13:56:51 2023 +0100 Merge pull request #834 from lexinor/patch-2 refactor(esx_service/server/main.lua): Added some new globalstate stuff and fixed stuff commit b09776b Merge: 3c4f81f 18c4d70 Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Wed Jan 18 13:51:46 2023 +0100 Merge pull request #837 from esx-framework/esx_phone_removing build: remove esx_phone commit 3c4f81f Merge: 3bc649d 935eb8f Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Wed Jan 18 13:40:43 2023 +0100 Merge pull request #843 from PoPoGH/main Create fr.lua commit 935eb8f Author: PoPo <76515395+PoPoGH@users.noreply.github.com> Date: Wed Jan 18 00:07:23 2023 +0100 Update fr.lua commit 06d17a6 Author: PoPo <76515395+PoPoGH@users.noreply.github.com> Date: Wed Jan 18 00:06:03 2023 +0100 add french locale some improvements commit 811636c Author: PoPo <76515395+PoPoGH@users.noreply.github.com> Date: Tue Jan 17 19:35:14 2023 +0100 Add French Language commit 3b7e428 Author: PoPo <76515395+PoPoGH@users.noreply.github.com> Date: Tue Jan 17 15:09:10 2023 +0100 Create fr.lua commit b7e5351 Author: Csoki <feketetibi71@gmail.com> Date: Mon Jan 16 13:38:55 2023 +0100 fix(esx_banking/client): cant open if player death add 'esx:onPlayerDeath' event commit 618eafc Author: Csoki <feketetibi71@gmail.com> Date: Mon Jan 16 13:26:22 2023 +0100 Update README.md -remove: ox target support -format commit 81c95b1 Merge: 472f33b 2e8871c Author: Csoki <feketetibi71@gmail.com> Date: Mon Jan 16 13:22:33 2023 +0100 Merge branch 'develop' of https://github.com/Rav3n95/esx-legacy into pr/838 commit 472f33b Author: Csoki <feketetibi71@gmail.com> Date: Mon Jan 16 13:21:31 2023 +0100 refactor(esx_banking/client): refactor some if conditions commit 8258d3f Author: P Gergő <paldi95@gmail.com> Date: Sat Jan 14 22:48:06 2023 +0100 or 10 fix: distance condition commit 2e8871c Author: P Gergő <paldi95@gmail.com> Date: Sat Jan 14 22:48:06 2023 +0100 or 10 commit c70cd30 Author: P Gergő <paldi95@gmail.com> Date: Sat Jan 14 22:39:06 2023 +0100 refactor(esx_banking) commit 3bc649d Merge: 3568d2b d300c1f Author: Gellipapa <gellerthorvath0@gmail.com> Date: Sat Jan 14 19:36:08 2023 +0100 Merge pull request #832 from Flambaa/feat/tr-locale feat(esx_accsessories): Add tr locales/translation commit 18c4d70 Author: Jean-Baptiste Devic <jean.baptiste.d06@gmail.com> Date: Sat Jan 14 13:52:41 2023 +0100 build: remove esx_phone commit 3568d2b Merge: 00c0006 c503b07 Author: Csoki <feketetibi71@gmail.com> Date: Sat Jan 14 10:59:55 2023 +0100 Merge pull request #835 from esx-framework/tony-stark-17-patch-1 Send lastJob data to client commit c503b07 Author: Tony Stark <76168122+tony-stark-17@users.noreply.github.com> Date: Sat Jan 14 13:24:55 2023 +0530 Send lastJob data to client commit 1d06e24 Author: Alessandro Alterno <28725795+lexinor@users.noreply.github.com> Date: Fri Jan 13 22:47:26 2023 +0100 Added some new globalstate stuff and fixed stuff - esx:playerDropped event was not working properly, source was not working, changed it to playerId - Added GlobalState[name] to make it easier to track onduty counters commit d300c1f Author: Flamba <denizakgxll@gmail.com> Date: Thu Jan 12 23:06:46 2023 +1100 feat(esx_accsessories): Add tr locales/translation commit 00c0006 Merge: cef3d21 d822a90 Author: Gellipapa <gellerthorvath0@gmail.com> Date: Wed Jan 11 00:41:02 2023 +0100 Merge pull request #830 from fivemland/fix-779-2 fix(esx_property): some fixes and refactor commit d822a90 Author: Csoki <feketetibi71@gmail.com> Date: Wed Dec 28 23:27:40 2022 +0100 fix(esx_multicharacter): update 'hu' locales # add missing locales # add new locales PR #777 commit 5836083 Author: Csoki <feketetibi71@gmail.com> Date: Wed Dec 28 23:13:09 2022 +0100 feat(esx_property): remove unused variables commit 5ad4c1b Author: Csoki <feketetibi71@gmail.com> Date: Wed Dec 28 23:03:45 2022 +0100 fix(esx_property): move 'es' locales to correct location commit d1e6491 Author: Csoki <feketetibi71@gmail.com> Date: Wed Dec 28 22:56:50 2022 +0100 feat(esx_property): update native names commit cef3d21 Merge: 8030c9f 99c8d11 Author: Gellipapa <gellerthorvath0@gmail.com> Date: Mon Jan 9 23:31:05 2023 +0100 Merge pull request #794 from fivemland/society-refactor refactor(esx_society) commit 8030c9f Merge: fda6249 78200ce Author: Gellipapa <gellerthorvath0@gmail.com> Date: Mon Jan 9 22:51:56 2023 +0100 Merge pull request #829 from Gellipapa/fix-2 fix(ex_extended locales.lua) fix nil value if change locales commit 99c8d11 Author: Csoki <feketetibi71@gmail.com> Date: Mon Jan 9 22:51:27 2023 +0100 fix commit 78200ce Author: Gellipapa <gellerthorvath0@gmail.com> Date: Mon Jan 9 22:47:23 2023 +0100 fix nil value if change locales commit 83833eb Merge: 25016e8 fda6249 Author: Csoki <feketetibi71@gmail.com> Date: Mon Jan 9 22:44:46 2023 +0100 Merge branch 'develop' into society-refactor commit fda6249 Merge: e10494a 163dd3b Author: Gellipapa <gellerthorvath0@gmail.com> Date: Mon Jan 9 22:27:09 2023 +0100 Merge pull request #799 from TheFantomas/main New year licenses 🎈 🎈 🎈 commit e10494a Merge: 24d4556 53d2aa5 Author: Gellipapa <gellerthorvath0@gmail.com> Date: Mon Jan 9 22:08:00 2023 +0100 Merge pull request #601 from AstroNext/AstroNext refactor(esx_menu_default/client/main.lua): Change isControlePress to ESX.RegisterInput commit 24d4556 Merge: 191088c f5e0115 Author: Jean-Baptiste <jean.baptiste.d06@gmail.com> Date: Mon Jan 9 19:41:21 2023 +0100 Merge pull request #823 from TheFantomas/main Add Feature Request and General Support commit 191088c Merge: 58e48df 21535af Author: Jean-Baptiste <jean.baptiste.d06@gmail.com> Date: Mon Jan 9 19:36:46 2023 +0100 Merge pull request #827 from esx-framework/main make dev up to date commit 58e48df Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Mon Jan 9 11:25:42 2023 +0100 Revert "Only show Default Inventory if Config enabled." This reverts commit 1abd1fb. commit ee09e06 Merge: aa3032c 23705a1 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Mon Jan 9 10:09:29 2023 +0000 Merge pull request #824 from Rav3n95/develop Fix for #821 commit aa3032c Merge: b62be9e c75e3a1 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Mon Jan 9 10:08:40 2023 +0000 Merge pull request #826 from iSentrie/patch-8 fix(esx_lscustom): Added 5th engine level commit c75e3a1 Author: iSentrie <xvender7@gmail.com> Date: Mon Jan 9 11:29:25 2023 +0200 Added 5th engine level Fix for vehicles that has 5 engine upgrades, example `shinobi` Prevents errors commit 23705a1 Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Sun Jan 8 18:31:48 2023 +0100 Forgotten print commit dd634b6 Author: P Gergő <69343477+Rav3n95@users.noreply.github.com> Date: Sun Jan 8 18:30:58 2023 +0100 Fixes commit f5e0115 Author: TheFarFantomas <thefarfantomas@gmail.com> Date: Sun Jan 8 17:55:09 2023 +0100 Add tag commit 8b9fb47 Author: TheFarFantomas <thefarfantomas@gmail.com> Date: Sun Jan 8 17:53:29 2023 +0100 Support commit 15d8a33 Author: TheFarFantomas <thefarfantomas@gmail.com> Date: Sun Jan 8 17:50:40 2023 +0100 Feature request commit 163dd3b Merge: ff5d728 b62be9e Author: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Sun Jan 8 17:33:26 2023 +0100 Merge branch 'develop' into main commit b62be9e Merge: 13be751 3ce0396 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 16:09:36 2023 +0000 Merge pull request #813 from zinzin92/main Create fr.lua commit 13be751 Merge: ddd19d0 effd985 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 16:07:54 2023 +0000 Merge pull request #778 from johnsoul777/main Fix Translate Saving commit ddd19d0 Merge: c501f3f c4cc984 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 16:04:27 2023 +0000 Merge pull request #811 from BeansFL/patch-3 Update de.lua commit c501f3f Merge: 86d03e7 56992cd Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 16:03:55 2023 +0000 Merge pull request #810 from BeansFL/patch-1 Update de.lua commit 86d03e7 Merge: ae8d408 e9e761b Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 16:02:40 2023 +0000 Merge pull request #816 from Zan1456/patch-3 Create ui_hu.html commit ae8d408 Merge: 7f53c70 de666f1 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 16:01:08 2023 +0000 Merge pull request #815 from Zan1456/patch-2 Create questions_hu.js commit 7f53c70 Merge: 63c06c0 ba4820c Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 15:58:58 2023 +0000 Merge pull request #814 from Zan1456/patch-1 Update hu.lua commit 63c06c0 Merge: 8c47f5f 36d0560 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 15:56:01 2023 +0000 Merge pull request #812 from BeansFL/patch-4 Update de.lua commit 8c47f5f Merge: 46fc5f4 81306d5 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 15:51:11 2023 +0000 Merge pull request #789 from Cartman117/patch-1 fix(esx_mechanicjob): Translation & Spawn vehicle from garage commit 46fc5f4 Merge: ba08825 842f221 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 15:49:02 2023 +0000 Merge pull request #798 from Mojito-Fivem/patch-1 Update readme.md commit ba08825 Merge: a8c424f 2a65918 Author: JackDUpModZ <83776161+JackDUpModZ@users.noreply.github.com> Date: Sun Jan 8 15:48:49 2023 +0000 Merge pull request #793 from fivemland/vehicleshop-refactor refactor(esx_vehicleshop) commit a8c424f Merge: 90c9777 1abd1fb Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Sun Jan 8 10:56:03 2023 +0100 Merge pull request #818 from Kuuzoo/patch-1 Only show Default Inventory if Config enabled. commit 90c9777 Merge: 5362966 77de399 Author: Benzo <102178921+Benzo00@users.noreply.github.com> Date: Sun Jan 8 10:55:38 2023 +0100 Merge pull request #808 from QB-Extended/main feat(es_extended): add message to event commit 1abd1fb Author: Kuuzoo <81863846+Kuuzoo@users.noreply.github.com> Date: Fri Jan 6 23:01:10 2023 +0100 Only show Default Inventory if Config enabled. On Itme Remove/Add the Default Inventory will now only show if enabled in the es_extended Config! commit e9e761b Author: Zan <62830223+Zan1456@users.noreply.github.com> Date: Fri Jan 6 11:46:26 2023 +0100 Create ui_hu.html commit de666f1 Author: Zan <62830223+Zan1456@users.noreply.github.com> Date: Fri Jan 6 11:46:02 2023 +0100 Create questions_hu.js commit ba4820c Author: Zan <62830223+Zan1456@users.noreply.github.com> Date: Fri Jan 6 11:42:08 2023 +0100 Update hu.lua commit 3ce0396 Author: Zinzin92 <kevin-descours@outlook.fr> Date: Thu Jan 5 12:16:02 2023 +0100 Create fr.lua commit 36d0560 Author: BeansFL <106496863+BeansFL@users.noreply.github.com> Date: Thu Jan 5 03:26:47 2023 +0100 Update de.lua commit c4cc984 Author: BeansFL <106496863+BeansFL@users.noreply.github.com> Date: Thu Jan 5 03:09:31 2023 +0100 Update de.lua commit 56992cd Author: BeansFL <106496863+BeansFL@users.noreply.github.com> Date: Thu Jan 5 02:57:03 2023 +0100 Update de.lua commit 77de399 Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Wed Jan 4 19:58:43 2023 +0000 fix: more race condition fixing commit 3892aa9 Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Wed Jan 4 18:59:30 2023 +0000 fix: society race conditions commit 43fe788 Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Wed Jan 4 18:52:48 2023 +0000 refactor(esx_society): allow registering society with exports commit c732d79 Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Wed Jan 4 18:50:34 2023 +0000 tweak(esx_society): better readme commit e9e4fa0 Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Wed Jan 4 00:17:51 2023 +0000 fix(es_extended): print formatting commit 5b2509b Author: Mycroft <kaseyfitton@hotmail.co.uk> Date: Tue Jan 3 23:14:27 2023 +0000 feat(es_extended): add message to event commit ff5d728 Merge: 63215f7 e0f55fc Author: TheFantomas <117121911+TheFantomas@users.noreply.github.com> Date: Mon Jan 2 21:01:20 2023 +0100 Merge branch 'develop' into main commit 63215f7 Author: TheFarFantomas <thefarfantomas@gmail.com> Date: Mon Jan 2 19:00:01 2023 +0100 Edit date in esx_identity commit 25441de Author: TheFarFantomas <thefarfantomas@gmail.com> Date: Mon Jan 2 18:57:43 2023 +0100 New year licenses commit 842f221 Author: Liam Dormon <66041893+Mojito-Fivem@users.noreply.github.com> Date: Mon Jan 2 17:06:59 2023 +0000 Update readme.md commit effd985 Author: AL1ƎN <72218928+johnsoul777@users.noreply.github.com> Date: Fri Dec 30 15:56:21 2022 +0100 Create es.js commit 0bc5589 Merge: 92b111c 17f96a7 Author: AL1ƎN <72218928+johnsoul777@users.noreply.github.com> Date: Fri Dec 30 15:55:12 2022 +0100 Merge branch 'esx-framework:main' into main commit 25016e8 Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 12:06:18 2022 +0100 refactor(esx_society): main/server.lua commit a759b4d Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 12:06:00 2022 +0100 fix(esx_society): invalid job bug commit 93d8a11 Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 11:28:11 2022 +0100 feat(esx_policejob): add esx_proprty dependency commit 88bbaa1 Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 11:27:10 2022 +0100 fix(esx_society): fix invalid job bug commit d572f1a Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 11:15:36 2022 +0100 feat(esx_society): add missing locales commit 2a65918 Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 10:41:57 2022 +0100 refactor(esx_vehicleshop): main/client.lua commit 6212076 Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 10:24:19 2022 +0100 fix(esx_vehicleshop): 'hu' locales commit fbbd6eb Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 10:01:51 2022 +0100 refactor(esx_vehicleshop): server/main.lua commit 43f44a0 Author: Csoki <feketetibi71@gmail.com> Date: Fri Dec 30 09:43:27 2022 +0100 refactor(esx_vehicleshop): GeneratePlate(), IsPlateTaken() commit 81306d5 Author: Cartman117 <121615906+Cartman117@users.noreply.github.com> Date: Thu Dec 29 14:02:01 2022 +0100 fix(esx_mechanicjob): French translation commit e6481e1 Author: Cartman117 <121615906+Cartman117@users.noreply.github.com> Date: Thu Dec 29 13:42:48 2022 +0100 fix(esx_mechanicjob): Spawn vehicule from garage If Config.EnableSocietyOwnedVehicles = true, spawning vehicule from garage wasn't possible because element.value = 'vehicle_list' but we want vehicule's informations (element2.value) commit 92b111c Author: AL1ƎN <72218928+johnsoul777@users.noreply.github.com> Date: Wed Dec 28 12:44:39 2022 +0100 Fix Translate Saving Fix Translate Saving commit 53d2aa5 Author: Amir_Lynx <60301485+AmirLynx@users.noreply.github.com> Date: Sat Oct 29 17:26:49 2022 +0330 change isControlePress to registerInput
Reduce usage to 0.0
faster key press then isControlePress
Close all menu's when namespace or resource restarted ( prevent stocked menu )