From 386fc60afda8941a319154f8fdb87e26ae49a614 Mon Sep 17 00:00:00 2001 From: Linden <65407488+thelindat@users.noreply.github.com> Date: Fri, 24 Feb 2023 04:24:51 +1100 Subject: [PATCH] fix(client/radial): refresh current submenu if path is still valid Resolves #424, hopefully without weird side effects. --- resource/interface/client/radial.lua | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/resource/interface/client/radial.lua b/resource/interface/client/radial.lua index 7430e3fa1..8b4f1f747 100644 --- a/resource/interface/client/radial.lua +++ b/resource/interface/client/radial.lua @@ -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 @@ -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