Skip to content

Commit 5b44bb7

Browse files
committed
use name from scenario data instead of dungeon journal
1 parent ab4d32c commit 5b44bb7

File tree

2 files changed

+3
-58
lines changed

2 files changed

+3
-58
lines changed

Display.lua

Lines changed: 3 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,6 @@ function MPT:UpdateBosses(Start, count, preview)
408408
local F = self.Frame
409409
if preview then
410410
local killtime = 0
411-
self:MuteJournalSounds()
412411
self.BossNames = {}
413412
self.MaxBossFrame = 5
414413
self:HideBossFrames()
@@ -440,33 +439,7 @@ function MPT:UpdateBosses(Start, count, preview)
440439
self.BossNames = {}
441440
local max = select(3, C_Scenario.GetStepInfo())
442441
if C_ScenarioInfo.GetCriteriaInfo(max) and C_ScenarioInfo.GetCriteriaInfo(max).isWeightedProgress then max = max-1 end -- if last criteria is enemy forces
443-
self:MuteJournalSounds()
444442
local mapID = C_Map.GetBestMapForUnit("player")
445-
local instanceID = (mapID and EJ_GetInstanceForMap(mapID)) or 0
446-
if instanceID == 0 or instanceID == nil then
447-
if self.cmap and self.maptoID[self.cmap] then
448-
instanceID = self.maptoID[self.cmap][1]
449-
end
450-
end
451-
if instanceID and instanceID ~= 0 then
452-
if not C_AddOns.IsAddOnLoaded("Blizzard_EncounterJournal") then C_AddOns.LoadAddOn("Blizzard_EncounterJournal") end
453-
EJ_SelectInstance(instanceID)
454-
for i=1, 20 do
455-
local name = EJ_GetEncounterInfoByIndex(i, instanceID)
456-
if name and name ~= "nil" then
457-
if self.cmap == 556 then
458-
if i == 3 then
459-
self.BossNames[3] = L["Quarry Camps Liberated"]
460-
self.BossNames[4] = name
461-
break
462-
end
463-
end
464-
self.BossNames[i] = name
465-
else
466-
break
467-
end
468-
end
469-
end
470443
if count <= 4 then -- check again in 2 seconds a few times to make sure data is correct
471444
C_Timer.After(2, function()
472445
self:UpdateBosses(true, count+1)
@@ -481,20 +454,12 @@ function MPT:UpdateBosses(Start, count, preview)
481454
for i=1, max do
482455
-- manually offset which bossname we want for megadungeons
483456
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
484-
-- Looking for 3rd Boss in 4th Objective for Pit of Saron
485-
num = (self.cmap == 556 and i == 4 and 3) or num
486457
-- limit how many bosses to show for some of the lower parts of megadungeons
487458
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)
488-
local name = self.BossNames[num]
489459
local criteria = C_ScenarioInfo.GetCriteriaInfo(i)
490-
for j = 1, #(self.BossNames) do
491-
if self.BossNames[j] and string.find(criteria.description, self.BossNames[j]) then
492-
name = self.BossNames[j]
493-
break
494-
end
495-
end
496-
if self.cmap == 556 and i == 3 then name = criteria.description end -- Using Blizzard's name for "Quarry camps liberated" since there is no other translated version to use
497-
if self.cmap == 227 and num == 3 then name = L["Opera Hall"] end -- figure out a way for localized name if the dungeon returns at some point
460+
local name = criteria.description and criteria.description:match("^(.+)%s+%S+$") or criteria.description
461+
self.BossNames[i] = name
462+
if self.cmap == 227 and num == 3 then name = L["Opera Hall"] end
498463
if name and name ~= "" and ((not maxbosses) or i <= maxbosses) then
499464
name = self:Utf8Sub(name, 1, self.BossName.MaxLength)
500465
self.MaxBossFrame = i
@@ -515,12 +480,10 @@ function MPT:UpdateBosses(Start, count, preview)
515480
self:ApplyTextSettings(frame["BossTimer"..i], self.BossTimer, criteria.quantityString.."/"..criteria.totalQuantity, BossColor)
516481
elseif pb2 and pb2[i] then
517482
local time = completed and (self.BossTimes[i] or select(2, GetWorldElapsedTime(1))-defeated) or pb2[i]
518-
if self.cmap == 556 and i == 3 then time = select(2, GetWorldElapsedTime(1)) end -- This one doesn't give info about the actual completion
519483
local timercolor = completed and ((pb2[i] == time and self.BossTimer.EqualColor) or (pb2[i] > time and self.BossTimer.SuccessColor) or self.BossTimer.FailColor) or self.BossTimer.Color
520484
self:ApplyTextSettings(frame["BossTimer"..i], self.BossTimer, self:FormatTime(time), timercolor)
521485
elseif completed then
522486
local time = self.BossTimes[i] or select(2, GetWorldElapsedTime(1))-defeated or 0
523-
if self.cmap == 556 and i == 3 then time = select(2, GetWorldElapsedTime(1)) end -- This one doesn't give info about the actual completion
524487
local timercolor = self.BossTimer.SuccessColor -- if there is no pb the default color should be the "success" color
525488
self:ApplyTextSettings(frame["BossTimer"..i], self.BossTimer, self:FormatTime(time), timercolor)
526489
end

Functions.lua

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,24 +12,6 @@ local SoundsToMute = {
1212
[567460] = true,
1313
}
1414

15-
function MPT:MuteJournalSounds()
16-
local sounds = {}
17-
for k, _ in pairs(SoundsToMute) do
18-
sounds[k] = select(2, PlaySoundFile(k))
19-
if sounds[k] then
20-
StopSound(sounds[k])
21-
MuteSoundFile(k)
22-
end
23-
end
24-
C_Timer.After(1, function()
25-
for k, _ in pairs(SoundsToMute) do
26-
if sounds[k] then
27-
UnmuteSoundFile(k)
28-
end
29-
end
30-
end)
31-
end
32-
3315
function MPT:PopupIsShown()
3416
for index = 1, 10 do
3517
local frame = _G["StaticPopup"..index]

0 commit comments

Comments
 (0)