mirror of
https://github.com/esx-framework/esx_core.git
synced 2026-08-29 01:08:54 +00:00
refactor(esx_menu_dialog): remove useless thread
if nui cursor is active, movement is disabled.
This commit is contained in:
@@ -30,10 +30,9 @@ local function closeMenu(namespace, name)
|
||||
name = name,
|
||||
})
|
||||
|
||||
if ESX.Table.SizeOf(OpenedMenus) == 0 then
|
||||
if not next(OpenedMenus) then
|
||||
SetNuiFocus(false)
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
ESX.UI.Menu.RegisterType(MenuType, openMenu, closeMenu)
|
||||
@@ -78,24 +77,4 @@ AddEventHandler('esx_menu_dialog:message:menu_change', function(data)
|
||||
if menu.change ~= nil then
|
||||
menu.change(data, menu)
|
||||
end
|
||||
end)
|
||||
|
||||
CreateThread(function()
|
||||
while true do
|
||||
Wait(0)
|
||||
|
||||
if ESX.Table.SizeOf(OpenedMenus) > 0 then
|
||||
DisableControlAction(0, 1, true) -- LookLeftRight
|
||||
DisableControlAction(0, 2, true) -- LookUpDown
|
||||
DisableControlAction(0, 142, true) -- MeleeAttackAlternate
|
||||
DisableControlAction(0, 106, true) -- VehicleMouseControlOverride
|
||||
DisableControlAction(0, 12, true) -- WeaponWheelUpDown
|
||||
DisableControlAction(0, 14, true) -- WeaponWheelNext
|
||||
DisableControlAction(0, 15, true) -- WeaponWheelPrev
|
||||
DisableControlAction(0, 16, true) -- SelectNextWeapon
|
||||
DisableControlAction(0, 17, true) -- SelectPrevWeapon
|
||||
else
|
||||
Wait(500)
|
||||
end
|
||||
end
|
||||
end)
|
||||
Reference in New Issue
Block a user