Skip to content

Commit ba94a41

Browse files
committed
Fix catalyst info missing on some previous season items, since blizzard removed upgrade track information for them (instead of greying it out) - fixes for seasons before TWW S2 will come later
1 parent d4f29dd commit ba94a41

File tree

2 files changed

+46
-1
lines changed

2 files changed

+46
-1
lines changed

TransmogUpgradeMaster.lua

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,14 +384,16 @@ function TUM:IsAppearanceMissing(itemLink, classID, debugLines)
384384
end
385385

386386
local currentTier = 0;
387-
if upgradeInfo then
387+
if upgradeInfo and upgradeInfo.currentLevel > 0 then
388388
currentTier = self.data.constants.trackStringIDToTiers[upgradeInfo.trackStringID] or 0
389389
if currentTier and upgradeInfo.currentLevel >= 5 and currentTier < 4 then
390390
currentTier = currentTier + 1
391391
end
392392
if canUpgrade and upgradeInfo.currentLevel < 5 and currentTier < 4 then
393393
result.canUpgrade = true
394394
end
395+
else
396+
currentTier = self:GetTierFromItemLevel(itemLink, seasonID) or 0
395397
end
396398
local _, sourceID = C_TransmogCollection.GetItemInfo(itemLink)
397399
tryInsert(debugLines, 'sourceID: ' .. tostring(sourceID))
@@ -633,6 +635,33 @@ function TUM:GetSourceIDsForItemID(itemID)
633635
return self.data.itemSourceIDs[itemID] or self.itemSourceIDs[itemID]
634636
end
635637

638+
--- @param itemLink string
639+
--- @param seasonID TUM_Season
640+
--- @return TUM_Tier? tier # nil if the tier cannot be determined from ilvl
641+
function TUM:GetTierFromItemLevel(itemLink, seasonID)
642+
local seasonInfo = self.data.upgradeItemLevels[seasonID]
643+
local tooltipData = C_TooltipInfo.GetHyperlink(itemLink)
644+
if not tooltipData or not seasonInfo then return nil end
645+
646+
local itemLevel
647+
for _, line in ipairs(tooltipData.lines) do
648+
if line.type == Enum.TooltipDataLineType.ItemLevel then
649+
itemLevel = line.itemLevel;
650+
break;
651+
end
652+
end
653+
if not itemLevel then return nil; end
654+
655+
local foundTier = nil
656+
for tier, minItemLevel in ipairs(seasonInfo) do
657+
if itemLevel >= minItemLevel then
658+
foundTier = tier;
659+
end
660+
end
661+
662+
return foundTier;
663+
end
664+
636665
--- @param itemLink string
637666
--- @param classID number # defaults to the player's class
638667
--- @return boolean

data.lua

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,22 @@ data.currency = {
141141
[TWW_S3] = 3269,
142142
};
143143

144+
--- @type table<TUM_Season, table<TUM_Tier, number>> # [seasonID][tier] = minimum item level
145+
data.upgradeItemLevels = {
146+
[TWW_S2] = {
147+
[TIER_LFR] = 623,
148+
[TIER_NORMAL] = 636,
149+
[TIER_HEROIC] = 649,
150+
[TIER_MYTHIC] = 662,
151+
},
152+
[TWW_S3] = {
153+
[TIER_LFR] = 668,
154+
[TIER_NORMAL] = 681,
155+
[TIER_HEROIC] = 694,
156+
[TIER_MYTHIC] = 707,
157+
},
158+
};
159+
144160
--- could potentially be extracted from C_TransmogSets.GetAllSets() more or less, but meh, effort, and requires linking to a specific season still anyway
145161
--- @type table<TUM_Season, table<number, {[1]:number, [2]:number, [3]:number, [4]:number}>> [m+ seasonID][classID] = { [1] = lfrSetID, [2] = normalSetID, [3] = heroicSetID, [4] = mythicSetID }
146162
data.sets = {

0 commit comments

Comments
 (0)