From 9dcaffde2452b447010eb2ecce0c3f767e64f9e5 Mon Sep 17 00:00:00 2001 From: Matthijs Groot // Justwait Date: Tue, 3 Dec 2024 12:45:58 +0100 Subject: [PATCH 1/4] Prevent TreeGroup buttons being broken somehow --- AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 89f387a..248a0e9 100644 --- a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -2,7 +2,7 @@ TreeGroup Container Container that uses a tree control to switch between groups. -------------------------------------------------------------------------------]] -local Type, Version = "TreeGroup", 47 +local Type, Version = "TreeGroup", 48 local AceGUI = LibStub and LibStub("AceGUI-3.0", true) if not AceGUI or (AceGUI:GetWidgetVersion(Type) or 0) >= Version then return end @@ -387,10 +387,6 @@ local methods = { ["RefreshTree"] = function(self,scrollToSelection,fromOnUpdate) local buttons = self.buttons local lines = self.lines - - for i, v in ipairs(buttons) do - v:Hide() - end while lines[1] do local t = tremove(lines) for k in pairs(t) do @@ -469,6 +465,9 @@ local methods = { end end + for i, v in ipairs(buttons) do + v.shouldBeHidden = true + end local buttonnum = 1 for i = first, last do local line = lines[i] @@ -496,9 +495,14 @@ local methods = { UpdateButton(button, line, status.selected == line.uniquevalue, line.hasChildren, groupstatus[line.uniquevalue] ) button:Show() + button.shouldBeHidden = nil buttonnum = buttonnum + 1 end - + for i, v in ipairs(buttons) do + if v.shouldBeHidden then + v:Hide() + end + end end, ["SetSelected"] = function(self, value) From efc312b849b573b789bbd2c630bcaaeb445565c3 Mon Sep 17 00:00:00 2001 From: Matthijs Groot // Justwait Date: Tue, 3 Dec 2024 12:56:48 +0100 Subject: [PATCH 2/4] Add Comment --- AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 248a0e9..a75ea55 100644 --- a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -465,6 +465,7 @@ local methods = { end end + -- We hide the buttons after updating them to avoid a blizzard bug that causes the buttons to still be interactable even when hidden. for i, v in ipairs(buttons) do v.shouldBeHidden = true end From 7b73b9a9bb1f54818a22af9a44c8d0d5b2a2abc6 Mon Sep 17 00:00:00 2001 From: Matthijs Groot // Justwait Date: Wed, 4 Dec 2024 18:24:07 +0100 Subject: [PATCH 3/4] Use buttonnum for the loop to hide --- AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index a75ea55..0e0da18 100644 --- a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -465,10 +465,6 @@ local methods = { end end - -- We hide the buttons after updating them to avoid a blizzard bug that causes the buttons to still be interactable even when hidden. - for i, v in ipairs(buttons) do - v.shouldBeHidden = true - end local buttonnum = 1 for i = first, last do local line = lines[i] @@ -496,13 +492,13 @@ local methods = { UpdateButton(button, line, status.selected == line.uniquevalue, line.hasChildren, groupstatus[line.uniquevalue] ) button:Show() - button.shouldBeHidden = nil buttonnum = buttonnum + 1 end - for i, v in ipairs(buttons) do - if v.shouldBeHidden then - v:Hide() - end + + -- We hide the remaining buttons after updating others to avoid a blizzard bug, + -- this used to be done for all buttons at the top of this function + for i = buttonnum, #buttons do + buttons[i]:Hide() end end, From e81693fe98b072b964d2425c245333fd95fcc321 Mon Sep 17 00:00:00 2001 From: Matthijs Groot // Justwait Date: Wed, 4 Dec 2024 18:25:46 +0100 Subject: [PATCH 4/4] update comment --- AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua index 0e0da18..7900937 100644 --- a/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua +++ b/AceGUI-3.0/widgets/AceGUIContainer-TreeGroup.lua @@ -495,8 +495,7 @@ local methods = { buttonnum = buttonnum + 1 end - -- We hide the remaining buttons after updating others to avoid a blizzard bug, - -- this used to be done for all buttons at the top of this function + -- We hide the remaining buttons after updating others to avoid a blizzard bug that keeps them interactable even if hidden when hidden before updating the buttons. for i = buttonnum, #buttons do buttons[i]:Hide() end