Skip to content

Commit

Permalink
Change Augmentation tooltip color to darkgreen. When leaving a m+ dun…
Browse files Browse the repository at this point in the history
…geon, wait 40 seconds before finishing and creating the overall m+ segment.
  • Loading branch information
Tercioo committed Mar 19, 2024
1 parent 0b7f4d2 commit c1fa712
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 17 deletions.
18 changes: 9 additions & 9 deletions classes/class_damage.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3615,7 +3615,7 @@ function damageClass.PredictedAugSpellsOnEnter(self)
local combatTimeMinutes, combatTimeSeconds = math.floor(combatTime / 60), math.floor(combatTime % 60)
GameCooltip:AddLine("Combat Time", combatTimeMinutes .. "m " .. combatTimeSeconds .. "s" .. " (" .. format("%.1f", 100) .. "%)")
GameCooltip:AddIcon([[Interface\TARGETINGFRAME\UnitFrameIcons]], nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Details:AddTooltipBackgroundStatusbar(false, 100, true, "limegreen")
Details:AddTooltipBackgroundStatusbar(false, 100, true, "darkgreen")

GameCooltip:AddLine("", "")
GameCooltip:AddIcon("", nil, nil, 1, 1)
Expand All @@ -3631,10 +3631,10 @@ function damageClass.PredictedAugSpellsOnEnter(self)
local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60)
if (minutes > 0) then
GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "darkgreen")
else
GameCooltip:AddLine(spellName, seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "darkgreen")
end

GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Expand All @@ -3659,10 +3659,10 @@ function damageClass.PredictedAugSpellsOnEnter(self)
local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60)
if (minutes > 0) then
GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "darkgreen")
else
GameCooltip:AddLine(spellName, seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "darkgreen")
end

GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Expand All @@ -3679,10 +3679,10 @@ function damageClass.PredictedAugSpellsOnEnter(self)
local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60)
if (minutes > 0) then
GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "darkgreen")
else
GameCooltip:AddLine(spellName, seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, "darkgreen")
end

GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Expand Down Expand Up @@ -3723,10 +3723,10 @@ function damageClass.PredictedAugSpellsOnEnter(self)
local minutes, seconds = math.floor(uptime / 60), math.floor(uptime % 60)
if (minutes > 0) then
GameCooltip:AddLine(spellName, minutes .. "m " .. seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "darkgreen")
else
GameCooltip:AddLine(spellName, seconds .. "s" .. " (" .. format("%.1f", uptimePercent) .. "%)")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "limegreen")
Details:AddTooltipBackgroundStatusbar(false, uptimePercent, true, sourceName and "darkgreen")
end

GameCooltip:AddIcon(spellIcon, nil, nil, iconSize, iconSize, iconBorderInfo.L, iconBorderInfo.R, iconBorderInfo.T, iconBorderInfo.B)
Expand Down
4 changes: 4 additions & 0 deletions core/parser.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5784,6 +5784,10 @@ local SPELL_POWER_PAIN = SPELL_POWER_PAIN or (PowerEnum and PowerEnum.Pain) or 1
if (Details.debug) then
end

if (DetailsMythicPlusFrame.ZoneLeftTimer and not DetailsMythicPlusFrame.ZoneLeftTimer:IsCancelled()) then
DetailsMythicPlusFrame.ZoneLeftTimer:Cancel()
end

local zoneName, instanceType, difficultyID, difficultyName, maxPlayers, dynamicDifficulty, isDynamic, instanceMapID, instanceGroupSize = GetInstanceInfo()
if (difficultyID == 8) then
Details222.MythicPlus.CHALLENGE_MODE_START_AT = GetTime()
Expand Down
37 changes: 29 additions & 8 deletions functions/mythicdungeon/mythicdungeon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,26 @@ function DetailsMythicPlusFrame.EventListener.OnDetailsEvent(contextObject, even
end
end

local playerLeftDungeonZoneTimer_Callback = function()
if (DetailsMythicPlusFrame.IsDoingMythicDungeon) then
local _, _, difficulty, _, _, _, _, currentZoneID = GetInstanceInfo()
if (currentZoneID ~= Details.MythicPlus.DungeonID) then
Details222.MythicPlus.LogStep("ZONE_CHANGED_NEW_AREA | player has left the dungeon and Details! finished the dungeon because of that.")

--send mythic dungeon end event
Details:SendEvent("COMBAT_MYTHICDUNGEON_END") --on leave dungeon

--finish the segment
DetailsMythicPlusFrame.BossDefeated(true)

--finish the mythic run
DetailsMythicPlusFrame.MythicDungeonFinished(true)

DetailsMythicPlusFrame.ZoneLeftTimer = nil
end
end
end

DetailsMythicPlusFrame:SetScript("OnEvent", function(_, event, ...)
if (event == "START_TIMER") then
--DetailsMythicPlusFrame.LastTimer = GetTime()
Expand All @@ -358,16 +378,17 @@ DetailsMythicPlusFrame:SetScript("OnEvent", function(_, event, ...)
print("Zone changed and the zone is different than the dungeon")
end

Details222.MythicPlus.LogStep("ZONE_CHANGED_NEW_AREA | player has left the dungeon and Details! finished the dungeon because of that.")

--send mythic dungeon end event
Details:SendEvent("COMBAT_MYTHICDUNGEON_END") --on leave dungeon
--player left the dungeon zone, start a timer to check if the player will return to the dungeon
if (DetailsMythicPlusFrame.DevelopmentDebug) then
print("Details!", "ZONE_CHANGED_NEW_AREA | player left the dungeon zone, return to dungeon timer started.")
end

--finish the segment
DetailsMythicPlusFrame.BossDefeated(true)
--check if the timer already exists, if does, ignore this event
if (DetailsMythicPlusFrame.ZoneLeftTimer and not DetailsMythicPlusFrame.ZoneLeftTimer:IsCancelled()) then
return
end

--finish the mythic run
DetailsMythicPlusFrame.MythicDungeonFinished(true)
DetailsMythicPlusFrame.ZoneLeftTimer = C_Timer.NewTimer(40, playerLeftDungeonZoneTimer_Callback)
end
end
end
Expand Down

0 comments on commit c1fa712

Please sign in to comment.