fix(web/radial): go back to correct more page when going back from sub

This commit is contained in:
Luke
2023-02-25 14:14:31 +01:00
parent b3b49b1cbd
commit 709d512422
2 changed files with 26 additions and 14 deletions

View File

@@ -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