Skip to content

Commit

Permalink
fix(client/radial): refresh current submenu if path is still valid
Browse files Browse the repository at this point in the history
Resolves #424, hopefully without weird side effects.
  • Loading branch information
thelindat committed Feb 23, 2023
1 parent 7f538f6 commit 386fc60
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions resource/interface/client/radial.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ local function showRadial(id)
})
end

---Refresh the global menu items or return from a submenu to its parent.
---Refresh the current menu items or return from a submenu to its parent.
local function refreshRadial(menuId)
if not isOpen then return end

Expand All @@ -66,7 +66,16 @@ local function refreshRadial(menuId)
local subMenuId = menuHistory[i]

if subMenuId == menuId then
currentRadial = menus[subMenuId]
local parent = menus[subMenuId]

for j = 1, #parent.items do
-- If we still have a path to the current submenu, refresh instead of returning
if parent.items[j].menu == currentRadial.id then
return showRadial(currentRadial.id)
end
end

currentRadial = parent

for j = #menuHistory, i, -1 do
menuHistory[j] = nil
Expand Down

0 comments on commit 386fc60

Please sign in to comment.