diff --git a/api/unitframes.lua b/api/unitframes.lua index 434fdb04..580a52a6 100644 --- a/api/unitframes.lua +++ b/api/unitframes.lua @@ -1014,7 +1014,7 @@ function pfUI.uf.OnEvent() -- Raid frames: update_full is set by raid.lua GUID tracker elseif this.label == "pet" and event == "UNIT_PET" then this.update_full = true - elseif this.label == "player" and (event == "PLAYER_AURAS_CHANGED" or event == "UNIT_INVENTORY_CHANGED") then + elseif this.label == "player" and (event == "PLAYER_AURAS_CHANGED" or event == "PLAYER_EQUIPMENT_CHANGED") then this.update_aura = true elseif this.label == "pet" and event == "UNIT_HAPPINESS" then this.update_full = true @@ -1552,7 +1552,7 @@ function pfUI.uf:EnableEvents() f:RegisterEvent("UNIT_FACTION") f:RegisterEvent("UNIT_AURA") -- frame=buff, frame=debuff f:RegisterEvent("PLAYER_AURAS_CHANGED") -- label=player && frame=buff - f:RegisterEvent("UNIT_INVENTORY_CHANGED") -- label=player && frame=buff + f:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") -- label=player && frame=buff (ClassicAPI: weapon-enchant buffs) f:RegisterEvent("PARTY_MEMBERS_CHANGED") -- label=party, frame=leaderIcon f:RegisterEvent("PARTY_LEADER_CHANGED") -- frame=leaderIcon f:RegisterEvent("RAID_ROSTER_UPDATE") -- label=raidIcon diff --git a/libs/libdebuff.lua b/libs/libdebuff.lua index acb4273a..21c86eb8 100644 --- a/libs/libdebuff.lua +++ b/libs/libdebuff.lua @@ -1536,7 +1536,6 @@ if hasNampower then -- CRITICAL FIX: Update ownDebuffs here too for refresh timing! -- This prevents the gap between DEBUFF_REMOVED and AURA_CAST where buffwatch shows nothing if isOurs and casterGuid then - local myGuid = GetPlayerGuid() if myGuid and casterGuid == myGuid then -- Check if we have timer data from allAuraCasts if allAuraCasts[guid] and allAuraCasts[guid][spellName] and allAuraCasts[guid][spellName][casterGuid] then diff --git a/libs/libpredict.lua b/libs/libpredict.lua index 0472af9e..aca70770 100644 --- a/libs/libpredict.lua +++ b/libs/libpredict.lua @@ -818,7 +818,7 @@ local hotsetbonus = libtipscan:GetScanner("hotsetbonus") resetcache:RegisterEvent("PLAYER_ENTERING_WORLD") resetcache:RegisterEvent("LEARNED_SPELL_IN_TAB") resetcache:RegisterEvent("CHARACTER_POINTS_CHANGED") -resetcache:RegisterEvent("UNIT_INVENTORY_CHANGED") +resetcache:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") resetcache:SetScript("OnEvent", function() if event == "PLAYER_ENTERING_WORLD" then -- load and initialize previous caches of spell amounts @@ -829,10 +829,7 @@ resetcache:SetScript("OnEvent", function() cache = pfUI_cache["prediction"][realm][player]["heals"] end - if event == "UNIT_INVENTORY_CHANGED" or "PLAYER_ENTERING_WORLD" then - -- skip non-player events - if arg1 and arg1 ~= "player" then return end - + if event == "PLAYER_EQUIPMENT_CHANGED" or event == "PLAYER_ENTERING_WORLD" then local gear = "" for id = 1, 18 do gear = gear .. (GetInventoryItemLink("player",id) or "") diff --git a/modules/buff.lua b/modules/buff.lua index 19f457f7..a361447d 100644 --- a/modules/buff.lua +++ b/modules/buff.lua @@ -159,7 +159,7 @@ pfUI:RegisterModule("buff", function () pfUI.buff = CreateFrame("Frame", "pfGlobalBuffFrame", UIParent) pfUI.buff:RegisterEvent("PLAYER_AURAS_CHANGED") - pfUI.buff:RegisterEvent("UNIT_INVENTORY_CHANGED") + pfUI.buff:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") pfUI.buff:RegisterEvent("UNIT_MODEL_CHANGED") pfUI.buff:RegisterEvent("BUFF_UPDATE_DURATION_SELF") pfUI.buff:RegisterEvent("DEBUFF_UPDATE_DURATION_SELF") diff --git a/modules/equipmentmanager.lua b/modules/equipmentmanager.lua index b1639f95..7ad69e46 100644 --- a/modules/equipmentmanager.lua +++ b/modules/equipmentmanager.lua @@ -1048,11 +1048,10 @@ pfUI:RegisterModule("equipmentmanager", function() events:RegisterEvent("EQUIPMENT_SETS_CHANGED") events:RegisterEvent("EQUIPMENT_SWAP_FINISHED") events:RegisterEvent("EQUIPMENT_SWAP_PENDING") - events:RegisterEvent("BAG_UPDATE_DELAYED") -- ClassicAPI debounced; ~4x fewer refreshes than BAG_UPDATE - events:RegisterEvent("UNIT_INVENTORY_CHANGED") + events:RegisterEvent("BAG_UPDATE_DELAYED") + events:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") events:SetScript("OnEvent", function() if not frame:IsShown() then return end - if event == "UNIT_INVENTORY_CHANGED" and arg1 ~= "player" then return end pfUI.equipmentmanager.Refresh() end) diff --git a/modules/panel.lua b/modules/panel.lua index 0198e413..2b4f5a90 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -424,7 +424,8 @@ pfUI:RegisterModule("panel", function() widget:RegisterEvent("PLAYER_REGEN_ENABLED") widget:RegisterEvent("PLAYER_DEAD") widget:RegisterEvent("PLAYER_UNGHOST") - widget:RegisterEvent("UNIT_INVENTORY_CHANGED") + widget:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") -- ClassicAPI: equip/unequip changes total durability + widget:RegisterEvent("UPDATE_INVENTORY_DURABILITY") -- ClassicAPI: combat wear / repair widget.Click = function() ToggleCharacter("PaperDollFrame") end widget.Tooltip = function() @@ -456,8 +457,6 @@ pfUI:RegisterModule("panel", function() end end widget:SetScript("OnEvent", function() - if event == "UNIT_INVENTORY_CHANGED" and arg1 ~= "player" then return end - local totalCurr, totalMax = 0, 0 for id = INVSLOT_FIRST_EQUIPPED, INVSLOT_LAST_EQUIPPED do local cur, max = GetInventoryItemDurability(id) diff --git a/modules/swingtimer.lua b/modules/swingtimer.lua index 23c016dd..3c9d9a04 100644 --- a/modules/swingtimer.lua +++ b/modules/swingtimer.lua @@ -788,7 +788,7 @@ pfUI:RegisterModule("swingtimer", function () events:RegisterEvent("AUTO_ATTACK_SELF") events:RegisterEvent("AUTO_ATTACK_OTHER") events:RegisterEvent("PLAYER_ENTERING_WORLD") - events:RegisterEvent("UNIT_INVENTORY_CHANGED") + events:RegisterEvent("PLAYER_EQUIPMENT_CHANGED") -- ClassicAPI: per-slot, equipment-only events:RegisterEvent("PLAYER_REGEN_DISABLED") events:RegisterEvent("PLAYER_REGEN_ENABLED") events:RegisterEvent("ACTIONBAR_SLOT_CHANGED") @@ -881,8 +881,9 @@ pfUI:RegisterModule("swingtimer", function () UpdateWeaponSpeeds() RebuildQueueSlotCache() - elseif event == "UNIT_INVENTORY_CHANGED" then - if arg1 and arg1 ~= "player" then return end + elseif event == "PLAYER_EQUIPMENT_CHANGED" then + -- arg1 = changed slot; only weapon slots (main/off/ranged) affect swing speed + if not INVSLOTS_EQUIPABLE_IN_COMBAT[arg1] then return end UpdateWeaponSpeeds() if S.ohSpeed == 0 then S.ohActive = false