Skip to content

Commit

Permalink
Updated Raid Vault tooltip to separate instances
Browse files Browse the repository at this point in the history
  • Loading branch information
Breeni committed Aug 20, 2022
1 parent 09f116f commit 87bdb29
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
1 change: 1 addition & 0 deletions .luacheckrc
Expand Up @@ -215,6 +215,7 @@ new_read_globals = {
'date',
'EditMacro',
'EJ_GetEncounterInfo',
'EJ_GetInstanceInfo',
'FindBaseSpellByID',
'format',
'GetAchievementCriteriaInfoByID',
Expand Down
15 changes: 10 additions & 5 deletions Register_Mainline.lua
Expand Up @@ -804,18 +804,23 @@ end
]],
tooltip = [[
tooltip:AddLine(self:GetName())
local instanceName = nil
for _,encounter in ipairs(states[1]:GetEncounters()) do
if instanceName ~= encounter.instanceName then
tooltip:AddLine(format("%s", encounter.instanceName), 1, 1, 1)
instanceName = encounter.instanceName
end
local name = encounter.name
if encounter.bestDifficulty == 16 then
tooltip:AddLine(format("%s (%s)", name, encounter.difficultyName), Colors.LEGENDARY:GetRGB())
tooltip:AddLine(format("- %s (%s)", name, encounter.difficultyName), Colors.LEGENDARY:GetRGB())
elseif encounter.bestDifficulty == 15 then
tooltip:AddLine(format("%s (%s)", name, encounter.difficultyName), Colors.EPIC:GetRGB())
tooltip:AddLine(format("- %s (%s)", name, encounter.difficultyName), Colors.EPIC:GetRGB())
elseif encounter.bestDifficulty == 14 then
tooltip:AddLine(format("%s (%s)", name, encounter.difficultyName), Colors.RARE:GetRGB())
tooltip:AddLine(format("- %s (%s)", name, encounter.difficultyName), Colors.RARE:GetRGB())
elseif encounter.bestDifficulty == 17 then
tooltip:AddLine(format("%s (%s)", name, encounter.difficultyName), Colors.UNCOMMON:GetRGB())
tooltip:AddLine(format("- %s (%s)", name, encounter.difficultyName), Colors.UNCOMMON:GetRGB())
else
tooltip:AddLine(name, 1, 1, 1)
tooltip:AddLine(format("- %s", name), 0.5, 0.5, 0.5)
end
end
]],
Expand Down
4 changes: 4 additions & 0 deletions States/Vault.lua
Expand Up @@ -100,12 +100,16 @@ function VaultMixin:GetEncounters()
if character:IsPlayer() then
encounters = C_WeeklyRewards.GetActivityEncounterInfo(self:GetID(), 3)
table.sort(encounters, function(a, b)
if a.instanceID ~= b.instanceID then
return a.instanceID < b.instanceID;
end
return a.uiOrder < b.uiOrder
end)
else
encounters = character:GetDataTable("vaultEncounters")
end
for _,encounter in ipairs(encounters) do
encounter.instanceName = encounter.instanceID and EJ_GetInstanceInfo(encounter.instanceID) or nil;
encounter.name = (EJ_GetEncounterInfo(encounter.encounterID))
if encounter.bestDifficulty > 0 then
encounter.difficultyName = DifficultyUtil.GetDifficultyName(encounter.bestDifficulty);
Expand Down

0 comments on commit 87bdb29

Please sign in to comment.