frrom retail

This commit is contained in:
Bunny67
2021-03-08 12:58:09 +03:00
parent 6e530142d3
commit cc4f2a33b6
3 changed files with 57 additions and 41 deletions
+49 -35
View File
@@ -1831,28 +1831,28 @@ do
cdReadyFrame:RegisterEvent("PLAYER_ENTERING_WORLD");
cdReadyFrame:SetScript("OnEvent", function(self, event, ...)
Private.StartProfileSystem("generictrigger cd tracking");
if not WeakAuras.IsPaused() then
if(event == "SPELL_UPDATE_COOLDOWN"
or event == "RUNE_POWER_UPDATE" or event == "RUNE_TYPE_UPDATE" or event == "ACTIONBAR_UPDATE_COOLDOWN"
or event == "PLAYER_TALENT_UPDATE"
or event == "CHARACTER_POINTS_CHANGED") then
Private.CheckCooldownReady();
elseif(event == "SPELLS_CHANGED") then
Private.CheckSpellKnown();
Private.CheckCooldownReady();
elseif(event == "UNIT_SPELLCAST_SENT") then
local unit, name, _ = ...;
if(unit == "player") then
if(gcdSpellName ~= name) then
local icon = GetSpellTexture(name);
gcdSpellName = name;
gcdSpellIcon = icon;
WeakAuras.ScanEvents("GCD_UPDATE");
if(event == "SPELL_UPDATE_COOLDOWN"
or event == "RUNE_POWER_UPDATE" or event == "RUNE_TYPE_UPDATE" or event == "ACTIONBAR_UPDATE_COOLDOWN"
or event == "PLAYER_TALENT_UPDATE"
or event == "CHARACTER_POINTS_CHANGED") then
Private.CheckCooldownReady();
elseif(event == "SPELLS_CHANGED") then
Private.CheckSpellKnown();
Private.CheckCooldownReady();
elseif(event == "UNIT_SPELLCAST_SENT") then
local unit, name, _ = ...;
if(unit == "player") then
if(gcdSpellName ~= name) then
local icon = GetSpellTexture(name);
gcdSpellName = name;
gcdSpellIcon = icon;
if not WeakAuras.IsPaused() then
WeakAuras.ScanEvents("GCD_UPDATE")
end
end
elseif(event == "UNIT_INVENTORY_CHANGED" or event == "BAG_UPDATE_COOLDOWN" or event == "PLAYER_EQUIPMENT_CHANGED") then
Private.CheckItemSlotCooldowns();
end
elseif(event == "UNIT_INVENTORY_CHANGED" or event == "BAG_UPDATE_COOLDOWN" or event == "PLAYER_EQUIPMENT_CHANGED") then
Private.CheckItemSlotCooldowns();
end
Private.StopProfileSystem("generictrigger cd tracking");
end);
@@ -2054,8 +2054,10 @@ do
for id, _ in pairs(spells) do
local known = WeakAuras.IsSpellKnownIncludingPet(id);
if (known ~= spellKnown[id]) then
spellKnown[id] = known;
WeakAuras.ScanEvents("SPELL_COOLDOWN_CHANGED", id);
spellKnown[id] = known
if not WeakAuras.IsPaused() then
WeakAuras.ScanEvents("SPELL_COOLDOWN_CHANGED", id)
end
end
end
end
@@ -2087,16 +2089,18 @@ do
changed = spellCdsOnlyCooldownRune:HandleSpell(id, startTimeCooldown, durationCooldown) or changed
end
if nowReady then
WeakAuras.ScanEvents("SPELL_COOLDOWN_READY", id);
end
if not WeakAuras.IsPaused() then
if nowReady then
WeakAuras.ScanEvents("SPELL_COOLDOWN_READY", id);
end
if changed or chargesChanged then
WeakAuras.ScanEvents("SPELL_COOLDOWN_CHANGED", id);
end
if changed or chargesChanged then
WeakAuras.ScanEvents("SPELL_COOLDOWN_CHANGED", id);
end
if (chargesDifference ~= 0 ) then
WeakAuras.ScanEvents("SPELL_CHARGES_CHANGED", id, chargesDifference, spellCount or 0);
if (chargesDifference ~= 0 ) then
WeakAuras.ScanEvents("SPELL_CHARGES_CHANGED", id, chargesDifference, spellCount or 0);
end
end
end
@@ -2133,7 +2137,9 @@ do
itemCdDurs[id] = duration;
itemCdExps[id] = endTime;
itemCdHandles[id] = timer:ScheduleTimer(ItemCooldownFinished, endTime - time, id);
WeakAuras.ScanEvents("ITEM_COOLDOWN_STARTED", id);
if not WeakAuras.IsPaused() then
WeakAuras.ScanEvents("ITEM_COOLDOWN_STARTED", id)
end
itemCdEnabledChanged = false;
elseif(itemCdExps[id] ~= endTime) then
-- Cooldown is now different
@@ -2143,7 +2149,9 @@ do
itemCdDurs[id] = duration;
itemCdExps[id] = endTime;
itemCdHandles[id] = timer:ScheduleTimer(ItemCooldownFinished, endTime - time, id);
WeakAuras.ScanEvents("ITEM_COOLDOWN_CHANGED", id);
if not WeakAuras.IsPaused() then
WeakAuras.ScanEvents("ITEM_COOLDOWN_CHANGED", id)
end
itemCdEnabledChanged = false;
end
elseif(duration > 0) then
@@ -2159,7 +2167,7 @@ do
itemCdEnabledChanged = false;
end
end
if (itemCdEnabledChanged) then
if (itemCdEnabledChanged and not WeakAuras.IsPaused()) then
WeakAuras.ScanEvents("ITEM_COOLDOWN_CHANGED", id);
end
end
@@ -2184,7 +2192,9 @@ do
itemSlotsCdDurs[id] = duration;
itemSlotsCdExps[id] = endTime;
itemSlotsCdHandles[id] = timer:ScheduleTimer(ItemSlotCooldownFinished, endTime - time, id);
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_STARTED", id);
if not WeakAuras.IsPaused() then
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_STARTED", id)
end
elseif(itemSlotsCdExps[id] ~= endTime) then
-- Cooldown is now different
if(itemSlotsCdHandles[id]) then
@@ -2193,7 +2203,9 @@ do
itemSlotsCdDurs[id] = duration;
itemSlotsCdExps[id] = endTime;
itemSlotsCdHandles[id] = timer:ScheduleTimer(ItemSlotCooldownFinished, endTime - time, id);
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_CHANGED", id);
if not WeakAuras.IsPaused() then
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_CHANGED", id)
end
end
elseif(duration > 0) then
-- GCD, do nothing
@@ -2210,7 +2222,9 @@ do
local newItemId = GetInventoryItemID("player", id);
if (itemId ~= newItemId) then
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_ITEM_CHANGED");
if not WeakAuras.IsPaused() then
WeakAuras.ScanEvents("ITEM_SLOT_COOLDOWN_ITEM_CHANGED")
end
itemSlots[id] = newItemId or 0;
end
end