Added support for mythic+ deaths
This commit is contained in:
+23
-5
@@ -6,19 +6,37 @@ local addonName, Details222 = ...
|
||||
|
||||
|
||||
Details222.Mixins.ActorMixin = {
|
||||
GetSpellContainer = function(self, containerType)
|
||||
---return a spellContainer from an actor
|
||||
---@param actor actor
|
||||
---@param containerType string
|
||||
---@return spellcontainer|nil
|
||||
GetSpellContainer = function(actor, containerType)
|
||||
if (containerType == "debuff") then
|
||||
return self.debuff_uptime_spells
|
||||
return actor.debuff_uptime_spells
|
||||
|
||||
elseif (containerType == "buff") then
|
||||
return self.buff_uptime_spells
|
||||
return actor.buff_uptime_spells
|
||||
|
||||
elseif (containerType == "spell") then
|
||||
return self.spells
|
||||
return actor.spells
|
||||
|
||||
elseif (containerType == "cooldowns") then
|
||||
return self.cooldowns_defensive_spells
|
||||
return actor.cooldowns_defensive_spells
|
||||
end
|
||||
end,
|
||||
|
||||
---return a spellTable from a spellContainer
|
||||
---@param actor actor
|
||||
---@param spellContainerName string
|
||||
---@param spellId number
|
||||
---@return spelltable|nil
|
||||
GetSpellTableFromContainer = function(actor, spellContainerName, spellId)
|
||||
---@type spellcontainer
|
||||
local spellContainer = actor[spellContainerName]
|
||||
if (spellContainer) then
|
||||
---@type spelltable
|
||||
local spellTable = spellContainer._ActorTable[spellId]
|
||||
return spellTable
|
||||
end
|
||||
end,
|
||||
}
|
||||
+14
-10
@@ -60,7 +60,7 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
|
||||
Details222.MythicPlus.LogStep("MergeSegmentsOnEnd started | creating the overall segment at the end of the run.")
|
||||
|
||||
--create a new combat to be the overall for the mythic run
|
||||
Details:EntrarEmCombate()
|
||||
Details:StartCombat()
|
||||
|
||||
--get the current combat just created and the table with all past segments
|
||||
local newCombat = Details:GetCurrentCombat()
|
||||
@@ -72,30 +72,32 @@ function DetailsMythicPlusFrame.MergeSegmentsOnEnd()
|
||||
local totalSegments = 0
|
||||
|
||||
--add all boss segments from this run to this new segment
|
||||
for i = 1, 25 do --from the newer combat to the oldest
|
||||
local pastCombat = segmentHistory [i]
|
||||
if (pastCombat and pastCombat.is_mythic_dungeon_run_id == Details.mythic_dungeon_id) then
|
||||
for i = 1, 40 do --from the newer combat to the oldest
|
||||
local thisCombat = segmentHistory[i]
|
||||
if (thisCombat and thisCombat.is_mythic_dungeon_run_id == Details.mythic_dungeon_id) then
|
||||
local canAddThisSegment = true
|
||||
if (_detalhes.mythic_plus.make_overall_boss_only) then
|
||||
if (not pastCombat.is_boss) then
|
||||
if (not thisCombat.is_boss) then
|
||||
canAddThisSegment = false
|
||||
end
|
||||
end
|
||||
|
||||
if (canAddThisSegment) then
|
||||
newCombat = newCombat + pastCombat
|
||||
totalTime = totalTime + pastCombat:GetCombatTime()
|
||||
newCombat = newCombat + thisCombat
|
||||
newCombat:CopyDeathsFrom(thisCombat, true)
|
||||
|
||||
totalTime = totalTime + thisCombat:GetCombatTime()
|
||||
totalSegments = totalSegments + 1
|
||||
|
||||
if (DetailsMythicPlusFrame.DevelopmentDebug) then
|
||||
print("MergeSegmentsOnEnd() > adding time:", pastCombat:GetCombatTime(), pastCombat.is_boss and pastCombat.is_boss.name)
|
||||
print("MergeSegmentsOnEnd() > adding time:", thisCombat:GetCombatTime(), thisCombat.is_boss and thisCombat.is_boss.name)
|
||||
end
|
||||
|
||||
if (endDate == "") then
|
||||
local _, whenEnded = pastCombat:GetDate()
|
||||
local _, whenEnded = thisCombat:GetDate()
|
||||
endDate =whenEnded
|
||||
end
|
||||
lastSegment = pastCombat
|
||||
lastSegment = thisCombat
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -187,6 +189,8 @@ function DetailsMythicPlusFrame.MergeTrashCleanup (isFromSchedule)
|
||||
newCombat = newCombat + pastCombat
|
||||
totalTime = totalTime + pastCombat:GetCombatTime()
|
||||
|
||||
newCombat:CopyDeathsFrom(pastCombat, true)
|
||||
|
||||
--tag this combat as already added to a boss trash overall
|
||||
pastCombat._trashoverallalreadyadded = true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user