mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 15:36:02 +01:00
fix(client/menu): don't call HudWeaponWheelIgnoreSelection for RedM
* Update menu.lua * Update menu.lua
This commit is contained in:
@@ -46,28 +46,27 @@ end
|
|||||||
---@param startIndex? number
|
---@param startIndex? number
|
||||||
function lib.showMenu(id, startIndex)
|
function lib.showMenu(id, startIndex)
|
||||||
local menu = registeredMenus[id]
|
local menu = registeredMenus[id]
|
||||||
|
|
||||||
if not menu then
|
if not menu then
|
||||||
error(('No menu with id %s was found'):format(id))
|
error(('No menu with id %s was found'):format(id))
|
||||||
end
|
end
|
||||||
|
|
||||||
if not openMenu then
|
if not openMenu then
|
||||||
local control = cache.game == 'fivem' and 140 or 0xE30CD707
|
local control = cache.game == 'fivem' and 140 or 0xE30CD707
|
||||||
|
|
||||||
CreateThread(function()
|
CreateThread(function()
|
||||||
while openMenu do
|
while openMenu do
|
||||||
if openMenu.disableInput == nil or openMenu.disableInput then
|
if openMenu.disableInput == nil or openMenu.disableInput then
|
||||||
DisablePlayerFiring(cache.playerId, true)
|
DisablePlayerFiring(cache.playerId, true)
|
||||||
HudWeaponWheelIgnoreSelection()
|
if cache.game == 'fivem' then
|
||||||
|
HudWeaponWheelIgnoreSelection() -- Not a REDM native
|
||||||
|
end
|
||||||
DisableControlAction(0, control, true)
|
DisableControlAction(0, control, true)
|
||||||
end
|
end
|
||||||
|
|
||||||
Wait(0)
|
Wait(0)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
openMenu = menu
|
openMenu = menu
|
||||||
|
|
||||||
lib.setNuiFocus(not menu.disableInput, true)
|
lib.setNuiFocus(not menu.disableInput, true)
|
||||||
|
|
||||||
SendNUIMessage({
|
SendNUIMessage({
|
||||||
@@ -81,7 +80,6 @@ function lib.showMenu(id, startIndex)
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
---@param onExit boolean?
|
---@param onExit boolean?
|
||||||
function lib.hideMenu(onExit)
|
function lib.hideMenu(onExit)
|
||||||
local menu = openMenu
|
local menu = openMenu
|
||||||
|
|||||||
Reference in New Issue
Block a user