mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-17 06:56:03 +01:00
fix(web/radial): go back to correct more page when going back from sub
This commit is contained in:
@@ -24,6 +24,9 @@ local menuHistory = {}
|
||||
---@type RadialMenuProps?
|
||||
local currentRadial = nil
|
||||
|
||||
---@type number | nil
|
||||
local menuPage = nil
|
||||
|
||||
---Open a the global radial menu or a registered radial submenu with the given id.
|
||||
---@param id string?
|
||||
local function showRadial(id)
|
||||
@@ -113,7 +116,7 @@ function lib.hideRadial()
|
||||
|
||||
SendNUIMessage({
|
||||
action = 'openRadialMenu',
|
||||
data = false
|
||||
data = menuPage or false
|
||||
})
|
||||
|
||||
SetNuiFocus(false, false)
|
||||
@@ -229,8 +232,11 @@ lib.addKeybind({
|
||||
defaultKey = 'z',
|
||||
onPressed = function()
|
||||
if isOpen then
|
||||
menuPage = 1
|
||||
return lib.hideRadial()
|
||||
end
|
||||
|
||||
menuPage = nil
|
||||
|
||||
if #menuItems == 0 or IsNuiFocused() or IsPauseMenuActive() then return end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user