The option to remove common segments now also removes trash between raid bosses

This commit is contained in:
Tercio Jose
2023-12-04 20:44:33 -03:00
parent 1c6bf8d2f1
commit 032279bd51
2 changed files with 19 additions and 14 deletions
+7 -3
View File
@@ -764,12 +764,14 @@ end
function segmentClass:ResetDataByCombatType(combatType)
local bIsException = false
local combatTypesInclusion = {}
if (combatType == "m+overall") then
combatType = DETAILS_SEGMENTTYPE_MYTHICDUNGEON_OVERALL
bIsException = true
elseif (combatType == "generic") then
combatType = DETAILS_SEGMENTTYPE_GENERIC
combatTypesInclusion[DETAILS_SEGMENTTYPE_GENERIC] = true
combatTypesInclusion[DETAILS_SEGMENTTYPE_RAID_TRASH] = true
end
--if true then return end
@@ -804,7 +806,7 @@ function segmentClass:ResetDataByCombatType(combatType)
for i = #segmentsTable, 2, -1 do
---@type combat
local thisCombatObject = segmentsTable[i]
if (thisCombatObject:GetCombatType() == combatType) then
if (combatTypesInclusion[thisCombatObject:GetCombatType()]) then
---@type boolean, combat|nil
local combatObjectRemoved = table.remove(segmentsTable, i)
if (combatObjectRemoved and combatObjectRemoved == thisCombatObject) then
@@ -952,7 +954,9 @@ function segmentClass:ResetAllCombatData()
end
local successful, errortext = pcall(cleargarbage)
if (not successful) then
Details:Msg("couldn't call collectgarbage()")
if (Details.debug) then
Details:Msg("couldn't call collectgarbage()")
end
end
else
Details.schedule_hard_garbage_collect = true
+12 -11
View File
@@ -6464,14 +6464,13 @@ local buildSegmentTooltip = function(self, deltaTime)
end
--sub menu
local decorrido = thisCombat:GetCombatTime()
local minutos, segundos = floor(decorrido/60), floor(decorrido%60)
local timeInCombat = thisCombat:GetCombatTime()
if (segmentID == "trashoverall") then
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer(decorrido), 2, "white", "white")
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer(timeInCombat), 2, "white", "white")
addIconAndStatusBar()
local totalRealTime = endedAt - startedAt
local wasted = totalRealTime - decorrido
local wasted = totalRealTime - timeInCombat
--wasted time
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer(wasted) .. " (" .. floor(wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white")
@@ -6480,19 +6479,21 @@ local buildSegmentTooltip = function(self, deltaTime)
addIconAndStatusBar()
elseif (isMythicOverallSegment) then
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer(decorrido), 2, "white", "white")
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TIMEINCOMBAT"] .. ":", Details.gump:IntegerToTimer(timeInCombat), 2, "white", "white")
addIconAndStatusBar()
local totalRealTime = endedAt - startedAt
local wasted = totalRealTime - decorrido
--wasted time
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer(wasted) .. " (" .. floor(wasted / totalRealTime * 100) .. "%)|r", 2, "white", "white")
addIconAndStatusBar(0.15)
local totalRealTime = thisCombat:GetRunTimeNoDefault() or (endedAt - startedAt)
local notInCombatTime = totalRealTime - timeInCombat
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_TOTALTIME"] .. ":", Details.gump:IntegerToTimer(totalRealTime), 2, "white", "white")
addIconAndStatusBar()
--wasted time
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_WASTED_TIME"] .. ":", "|cFFFF3300" .. Details.gump:IntegerToTimer(notInCombatTime) .. " (" .. floor(notInCombatTime / totalRealTime * 100) .. "%)|r", 2, "white", "white")
addIconAndStatusBar(0.15)
else
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", Details.gump:IntegerToTimer(decorrido), 2, "white", "white")
gameCooltip:AddLine(Loc["STRING_SEGMENTS_LIST_COMBATTIME"] .. ":", Details.gump:IntegerToTimer(timeInCombat), 2, "white", "white")
addIconAndStatusBar()
end