From 6e1293dc56bff808ca7b3f1495f6e90be01f9751 Mon Sep 17 00:00:00 2001 From: ckaotik Date: Thu, 6 Aug 2015 15:04:29 +0200 Subject: [PATCH] Fixed locked item indicator not updating when changing sets. --- TopFit.lua | 3 ++- modules/ui.character.lua | 18 ++++++++++++++---- 2 files changed, 16 insertions(+), 5 deletions(-) diff --git a/TopFit.lua b/TopFit.lua index 880c748..86048ee 100644 --- a/TopFit.lua +++ b/TopFit.lua @@ -302,7 +302,8 @@ function ns:SetSelectedSet(setID) end end - ns.ui.Update(true) + ns.ui.UpdateForcedSlotIndicators() -- character frame ui + ns.ui.Update(true) -- topfit frame ui end -- get a list of all set IDs in the database diff --git a/modules/ui.character.lua b/modules/ui.character.lua index 778e36b..bd92769 100644 --- a/modules/ui.character.lua +++ b/modules/ui.character.lua @@ -344,11 +344,21 @@ local function UpdateForcedSlotIndicator(slotButton) indicator:Hide() end end -hooksecurefunc("PaperDollItemSlotButton_OnShow", function(self, isBag) - if not isBag then - UpdateForcedSlotIndicator(self) + +local paperDollItemButtons = {} +for _, button in pairs({ PaperDollItemsFrame:GetChildren() }) do + local slotID = button.GetID and button:GetID() or nil + if slotID then + paperDollItemButtons[slotID] = button end -end) +end +function ui.UpdateForcedSlotIndicators(slot) + for slotID, slotButton in pairs(paperDollItemButtons) do + if not slot or slot == slotID then + UpdateForcedSlotIndicator(slotButton) + end + end +end -- ---------------------------------------------- -- item flyout forcing