From 3adadfe17ab1d2d197ab7a090ffdebc941dd8271 Mon Sep 17 00:00:00 2001 From: Tercio Jose Date: Sat, 9 Sep 2023 17:05:46 -0300 Subject: [PATCH] Fixed an issue with classicEra and Wrath game versions --- Libs/DF/icon.lua | 7 +++- boot.lua | 4 +- core/parser.lua | 99 ++++++++++++++++++++++++++---------------------- 3 files changed, 61 insertions(+), 49 deletions(-) diff --git a/Libs/DF/icon.lua b/Libs/DF/icon.lua index 2fe0defdc..a08c7f324 100644 --- a/Libs/DF/icon.lua +++ b/Libs/DF/icon.lua @@ -795,7 +795,12 @@ detailsFramework.IconMixin = { end end - self:AlignAuraIcons() + --if there's nothing to show, no need to align + if (not next(self.AuraCache)) then + self:Hide() + else + self:AlignAuraIcons() + end end, ---@param self df_iconrow the parent frame diff --git a/boot.lua b/boot.lua index 8e510e788..e2af58ede 100644 --- a/boot.lua +++ b/boot.lua @@ -13,8 +13,8 @@ local addonName, Details222 = ... local version, build, date, tocversion = GetBuildInfo() - Details.build_counter = 11901 - Details.alpha_build_counter = 11901 --if this is higher than the regular counter, use it instead + Details.build_counter = 11902 + Details.alpha_build_counter = 11902 --if this is higher than the regular counter, use it instead Details.dont_open_news = true Details.game_version = version Details.userversion = version .. " " .. Details.build_counter diff --git a/core/parser.lua b/core/parser.lua index 23f9f0ce4..b8b538fc5 100755 --- a/core/parser.lua +++ b/core/parser.lua @@ -3941,7 +3941,12 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 end _spell_utility_func(spell, targetSerial, targetName, targetFlags, sourceName, token, extraSpellID, extraSpellName) - --verifica se tem dono e adiciona o interrupt para o dono + if (spellId == 19647) then + --spell lock (warlock pet) + --Details:Msg("warlock pet interrupt, owner:", (ownerActor and ownerActor.nome or "no owner")) + end + + --if the interrupt is from a pet, then we need to add the interrupt to the owner if (ownerActor) then if (not ownerActor.interrupt) then ownerActor.interrupt = Details:GetOrderNumber(sourceName) @@ -3950,16 +3955,15 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 ownerActor.interrompeu_oque = {} end - -- adiciona ao total + ownerActor.last_event = _tempo + + --total interrupts ownerActor.interrupt = ownerActor.interrupt + 1 - -- adiciona aos alvos + --add to interrupt targets ownerActor.interrupt_targets[targetName] = (ownerActor.interrupt_targets[targetName] or 0) + 1 - -- update last event - ownerActor.last_event = _tempo - - -- spells interrupted + --which spells this actor interrupted ownerActor.interrompeu_oque[extraSpellID] = (ownerActor.interrompeu_oque[extraSpellID] or 0) + 1 --pet interrupt @@ -5524,52 +5528,55 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1 Details.tabela_vigente.CombatStartedAt = GetTime() - local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0") - wipe(gearCache) - local bNeedPlayerGear = true - - if (IsInRaid()) then - local unitIdCache = Details222.UnitIdCache.Raid - bNeedPlayerGear = false - - for i = 1, 40 do - local unitId = unitIdCache[i] - local guid = UnitGUID(unitId) - if (guid) then - local unitGearInfo = openRaidLib.GetUnitGear(unitId) - if (unitGearInfo) then - gearCache[guid] = { - tierAmount = unitGearInfo.tierAmount or 0, - ilevel = unitGearInfo.ilevel or 0, - } + local bSilentOnError = true + local openRaidLib = LibStub:GetLibrary("LibOpenRaid-1.0", bSilentOnError) --isWOTLK isERA + if (openRaidLib) then + wipe(gearCache) + local bNeedPlayerGear = true + + if (IsInRaid()) then + local unitIdCache = Details222.UnitIdCache.Raid + bNeedPlayerGear = false + + for i = 1, 40 do + local unitId = unitIdCache[i] + local guid = UnitGUID(unitId) + if (guid) then + local unitGearInfo = openRaidLib.GetUnitGear(unitId) + if (unitGearInfo) then + gearCache[guid] = { + tierAmount = unitGearInfo.tierAmount or 0, + ilevel = unitGearInfo.ilevel or 0, + } + end end end - end - elseif (IsInGroup()) then - local unitIdCache = Details222.UnitIdCache.Party - for i = 1, 4 do - local unitId = unitIdCache[i] - local guid = UnitGUID(unitId) - if (guid) then - local unitGearInfo = openRaidLib.GetUnitGear(unitId) - if (unitGearInfo) then - gearCache[guid] = { - tierAmount = unitGearInfo.tierAmount or 0, - ilevel = unitGearInfo.ilevel or 0, - } + elseif (IsInGroup()) then + local unitIdCache = Details222.UnitIdCache.Party + for i = 1, 4 do + local unitId = unitIdCache[i] + local guid = UnitGUID(unitId) + if (guid) then + local unitGearInfo = openRaidLib.GetUnitGear(unitId) + if (unitGearInfo) then + gearCache[guid] = { + tierAmount = unitGearInfo.tierAmount or 0, + ilevel = unitGearInfo.ilevel or 0, + } + end end end end - end - if (bNeedPlayerGear) then - local playerGearInfo = openRaidLib.GetUnitGear("player") - if (playerGearInfo) then - gearCache[UnitGUID("player")] = { - tierAmount = playerGearInfo.tierAmount or 0, - ilevel = playerGearInfo.ilevel or 0, - } + if (bNeedPlayerGear) then + local playerGearInfo = openRaidLib.GetUnitGear("player") + if (playerGearInfo) then + gearCache[UnitGUID("player")] = { + tierAmount = playerGearInfo.tierAmount or 0, + ilevel = playerGearInfo.ilevel or 0, + } + end end end end