From fbb0c4c2543d7adcda2e04a1d7b53ad2986b95a0 Mon Sep 17 00:00:00 2001 From: Brues <5278969+brues-code@users.noreply.github.com> Date: Fri, 23 Oct 2026 02:00:27 -0500 Subject: [PATCH] Refresh unusable bag tint when item requirements change --- modules/unusable.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/modules/unusable.lua b/modules/unusable.lua index 227badc1..03aaba33 100644 --- a/modules/unusable.lua +++ b/modules/unusable.lua @@ -34,4 +34,24 @@ pfUI:RegisterModule("unusable", function () hooksecurefunc("BankFrameItemButton_UpdateLock", function() pfUI.unusable:UpdateSlot(-1, this:GetID()) end) + + -- requirement changes (level, proficiency/skill, required spell, reputation, + -- honor rank) don't touch the bags; queue a full rebag through pfUI.bag's + -- coalesced delay, whose UpdateSlot resets the tint before we reapply it + local refresh = CreateFrame("Frame") + refresh:RegisterEvent("PLAYER_LEVEL_UP") + refresh:RegisterEvent("SKILL_LINES_CHANGED") + refresh:RegisterEvent("SPELLS_CHANGED") + refresh:RegisterEvent("FACTION_STANDING_CHANGED") + refresh:RegisterEvent("PLAYER_PVP_RANK_CHANGED") + refresh:SetScript("OnEvent", function() + for _, bag in pairs(pfUI.BACKPACK) do + pfUI.bag.delay.UpdateBag[bag] = true + end + if pfUI.bag.left:IsShown() then + for _, bag in pairs(pfUI.BANK) do + pfUI.bag.delay.UpdateBag[bag] = true + end + end + end) end)