Skip to content

Commit a08159d

Browse files
committed
fix mega dungeon display
1 parent 4de8661 commit a08159d

File tree

1 file changed

+10
-9
lines changed

1 file changed

+10
-9
lines changed

Display.lua

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -80,9 +80,6 @@ function MPT:CreateStates(preview)
8080

8181
-- Bosses
8282
F.Bosses = {}
83-
for i=1, 5 do -- Boss Bars & Texts
84-
self:CreateBossFrame(i)
85-
end
8683

8784
-- Enemy Forces
8885
self:CreateStatusBar(F, "ForcesBar", true, true)
@@ -309,7 +306,7 @@ function MPT:DisplayTimerElements(chest, completion, preview, diff)
309306
timertext = timeMS and ("%s%s"):format(timertext, timeMS) or timertext
310307
end
311308
local upgrades = completion and C_ChallengeMode.GetChallengeCompletionInfo().keystoneUpgradeLevels or 0
312-
local timercolor = (completion and (C_ChallengeMode.GetChallengeCompletionInfo().onTime and self.TimerText.SuccessColor or self.TimerText.FailColor)) or self.TimerText.Color
309+
local timercolor = ((not preview) and completion and (C_ChallengeMode.GetChallengeCompletionInfo().onTime and self.TimerText.SuccessColor or self.TimerText.FailColor)) or self.TimerText.Color
313310
self:ApplyTextSettings(F.TimerBar.TimerText, self.TimerText, string.format("%s/%s", timertext, self:FormatTime(self.timelimit)), timercolor)
314311
if diff or preview then
315312
local ComparisonTime = preview and math.random(-200, 200) or diff or 0 -- math.random(-200, 200)
@@ -333,8 +330,8 @@ function MPT:DisplayTimerElements(chest, completion, preview, diff)
333330
local prefix = ""
334331
if remTime < 0 then prefix = "+" remTime = remTime*-1 end
335332
if completion then
336-
color = upgrades < i and self["ChestTimer"..i].BehindColor or self["ChestTimer"..i].AheadColor
337-
prefix = upgrades < i and "+" or "-"
333+
color = (preview and self["ChestTimer"..i].Color) or (upgrades < i and self["ChestTimer"..i].BehindColor or self["ChestTimer"..i].AheadColor)
334+
prefix = (preview and "") or (upgrades < i and "+" or "-")
338335
end
339336
self:ApplyTextSettings(F.TimerBar["ChestTimer"..i], self["ChestTimer"..i], prefix..self:FormatTime(remTime), color, false, i)
340337
else
@@ -427,7 +424,10 @@ function MPT:UpdateBosses(Start, count, preview)
427424
local pb = self.BossSplit.enabled and self:GetPB(self.cmap, self.level, self.seasonID, self.LowerKey)
428425
local pb2 = self.BossTimer.enabled and self:GetPB(self.cmap, self.level, self.seasonID, self.LowerKey)
429426
for i=1, max do
427+
-- manually offset which bossname we want for megadungeons
430428
local num = (self.cmap == 370 and i+4) or (self.cmap == 392 and i+5) or (self.cmap == 227 and i+2) or (self.cmap == 234 and i+6) or (self.cmap == 464 and i+4) or i
429+
-- limit how many bosses to show for some of the lower parts of megadungeons
430+
local maxbosses = (self.cmap == 391 and 5) or (self.cmap == 463 and 4) or (self.cmap == 227 and 3) or (self.cmap == 369 and 4)
431431
local name = self.BossNames[num]
432432
local criteria = C_ScenarioInfo.GetCriteriaInfo(i)
433433
for j = 1, #(self.BossNames) do
@@ -436,8 +436,8 @@ function MPT:UpdateBosses(Start, count, preview)
436436
break
437437
end
438438
end
439-
if self.cmap == 227 and num == 3 then name = "Opera Hall" end
440-
if name and name ~= "" then
439+
if self.cmap == 227 and num == 3 then name = "Opera Hall" end
440+
if name and name ~= "" and ((not maxbosses) or i <= maxbosses) then
441441
name = self:Utf8Sub(name, 1, self.BossName.MaxLength)
442442
self.MaxBossFrame = i
443443
local completed = criteria.completed
@@ -471,10 +471,11 @@ function MPT:UpdateBosses(Start, count, preview)
471471
frame:Show()
472472
end
473473
end
474-
if self.MaxBossFrame > self.PreviousMaxBossFrame then -- re-anchor other elements if they are anchored to Bosses
474+
if self.MaxBossFrame ~= self.PreviousMaxBossFrame then -- re-anchor other elements if they are anchored to Bosses
475475
if self.KeyInfo.AnchoredTo == "Bosses" then self:UpdateKeyInfo(true, true) end
476476
if self.TimerBar.AnchoredTo == "Bosses" then self:UpdateTimerBar(true) end
477477
if self.ForcesBar.AnchoredTo == "Bosses" then self:UpdateEnemyForces(true) end
478+
self:UpdateMainFrame(true)
478479
end
479480
self.PreviousMaxBossFrame = self.MaxBossFrame
480481
if self.MaxBossFrame == 0 then

0 commit comments

Comments
 (0)