From 9c1eab049e90f097f06c89a9429a5986953c0687 Mon Sep 17 00:00:00 2001 From: AndyMM22 Date: Sat, 8 Aug 2026 08:57:40 +0200 Subject: [PATCH] Stop the delve items popup working on every frame --- Modules/DelveItemsPopup.lua | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) diff --git a/Modules/DelveItemsPopup.lua b/Modules/DelveItemsPopup.lua index 98e41051..0bbfaee2 100644 --- a/Modules/DelveItemsPopup.lua +++ b/Modules/DelveItemsPopup.lua @@ -753,21 +753,26 @@ end RebuildSpellIdMap() +local activeCache, activeCacheAt = {}, 0 + function ns:IsDelveConsumableActive(itemID) SyncDelveConsumableSession() if delveConsumablesUsed[itemID] then return true end - if PlayerHasActiveBuffsForItem(itemID) then - return true - end - if PlayerHasDelveConsumableUseLock(itemID) then - return true + local now = GetTime() + if now - activeCacheAt > 0.5 then + activeCache, activeCacheAt = {}, now end - if PlayerCarriesUnusableDelveItem(itemID) then - return true + local cached = activeCache[itemID] + if cached ~= nil then + return cached end - return false + local active = PlayerHasActiveBuffsForItem(itemID) + or PlayerHasDelveConsumableUseLock(itemID) + or PlayerCarriesUnusableDelveItem(itemID) + activeCache[itemID] = active + return active end function ns:ShouldAdviseDelveConsumable(itemID) @@ -1007,8 +1012,13 @@ local function GetPopupSecureForRow(row) btn:SetPoint("CENTER", UIParent, "CENTER", 0, 0) btn:Hide() end + if btn._mhConfiguredFor == row.itemID then + btn._row = row + return btn + end btn:RegisterForClicks("AnyUp", "AnyDown") ApplyPopupSlotSecureAction(btn, row.itemID) + btn._mhConfiguredFor = row.itemID EnsurePopupSecureHitTexture(btn) btn._row = row btn._mhSecureUseSlot = true @@ -1629,6 +1639,12 @@ local function EnsurePopupFrame() end return end + self._mhTickElapsed = (self._mhTickElapsed or 0) + elapsed + if self._mhTickElapsed < 0.25 then + return + end + elapsed = self._mhTickElapsed + self._mhTickElapsed = 0 if InCombatLockdown() and IsDelveItemsUiAllowed() then self._mhCombatStateElapsed = (self._mhCombatStateElapsed or 0) + elapsed if self._mhCombatStateElapsed >= 0.5 then