diff --git a/classes/container_segments.lua b/classes/container_segments.lua index b1194841..27b1ce8a 100644 --- a/classes/container_segments.lua +++ b/classes/container_segments.lua @@ -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 diff --git a/frames/window_main.lua b/frames/window_main.lua index 2b0e00c1..2c238957 100644 --- a/frames/window_main.lua +++ b/frames/window_main.lua @@ -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