Skip to content

Commit

Permalink
Fixed an issue with classicEra and Wrath game versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Sep 9, 2023
1 parent 5e9a08f commit 3adadfe
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 49 deletions.
7 changes: 6 additions & 1 deletion Libs/DF/icon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions boot.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
99 changes: 53 additions & 46 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 3adadfe

Please sign in to comment.