mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-11-23 11:28:36 +00:00
fix(web/radial): check whether radial menu was closed during transition
Closing the radial menu during the transition from the more pages would cause the menu to be stuck open
This commit is contained in:
1 parent
709d512422
commit
6e1a978038
2 files changed
+18
-3
No files matched your search
@@ -207,6 +207,9 @@ RegisterNUICallback('radialBack', function(_, cb)
|
||||
|
||||
Wait(100)
|
||||
|
||||
-- If menu was closed during transition, don't open the submenu
|
||||
if not isOpen then return end
|
||||
|
||||
SendNUIMessage({
|
||||
action = 'openRadialMenu',
|
||||
data = {
|
||||
@@ -226,6 +229,15 @@ RegisterNUICallback('radialClose', function(_, cb)
|
||||
currentRadial = nil
|
||||
end)
|
||||
|
||||
RegisterNUICallback('radialTransition', function(_, cb)
|
||||
Wait(100)
|
||||
|
||||
-- If menu was closed during transition, don't open the submenu
|
||||
if not isOpen then return cb(false) end
|
||||
|
||||
cb(true)
|
||||
end)
|
||||
|
||||
lib.addKeybind({
|
||||
name = 'ox_lib-radial',
|
||||
description = 'Open radial menu',
|
||||
@@ -235,7 +247,7 @@ lib.addKeybind({
|
||||
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