Skip to content

Commit 60cf0e0

Browse files
committed
Initial Midnight Season 1 support
1 parent 5f96b8b commit 60cf0e0

File tree

3 files changed

+247
-15
lines changed

3 files changed

+247
-15
lines changed

TransmogUpgradeMaster.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ local name = ...;
22
--- @class TUM_NS
33
local ns = select(2, ...);
44

5+
local isMidnight = select(4, GetBuildInfo()) >= 120000;
6+
57
--- @class TransmogUpgradeMaster
68
local TUM = {}
79
TransmogUpgradeMaster = TUM
@@ -271,6 +273,7 @@ end
271273
--- @param itemLink string
272274
--- @return boolean
273275
function TUM:IsCurrentSeasonItem(itemLink)
276+
if isMidnight then return false end -- @todo find a better check for this
274277
local data = C_TooltipInfo.GetHyperlink(itemLink);
275278
for _, line in ipairs(data and data.lines or {}) do
276279
if line and line.leftText and line.leftText:match(ITEM_UPGRADE_TOOLTIP_PATTERN) then

collectionUi.lua

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,20 @@ local addonName = ...;
33
local ns = select(2, ...);
44

55
local TUM = ns.core;
6+
local data = TUM.data;
67

78
local isSyndicatorLoaded = C_AddOns.IsAddOnLoaded('Syndicator');
89

910
local SEASON_NAMES = {
10-
[8] = 'SL S4',
11-
[9] = 'DF S1',
12-
[10] = 'DF S2',
13-
[11] = 'DF S3',
14-
[12] = 'DF S4',
15-
[13] = 'TWW S1',
16-
[14] = 'TWW S2',
17-
[15] = 'TWW S3',
11+
[data.constants.seasons.SL_S4] = 'SL S4',
12+
[data.constants.seasons.DF_S1] = 'DF S1',
13+
[data.constants.seasons.DF_S2] = 'DF S2',
14+
[data.constants.seasons.DF_S3] = 'DF S3',
15+
[data.constants.seasons.DF_S4] = 'DF S4',
16+
[data.constants.seasons.TWW_S1] = 'TWW S1',
17+
[data.constants.seasons.TWW_S2] = 'TWW S2',
18+
[data.constants.seasons.TWW_S3] = 'TWW S3',
19+
[data.constants.seasons.MN_S1] = 'MN S1',
1820
};
1921
local CATALYST_MARKUP = CreateAtlasMarkup('CreationCatalyst-32x32', 18, 18)
2022
local UPGRADE_MARKUP = CreateAtlasMarkup('CovenantSanctum-Upgrade-Icon-Available', 18, 18)
@@ -214,13 +216,13 @@ function UI:BuildUI()
214216
UI.selectedSeason = seasonID;
215217
UI:DeferUpdateItems();
216218
end
217-
local orderedSeasonIDs = {};
218-
for seasonID, _ in pairs(SEASON_NAMES) do
219-
table.insert(orderedSeasonIDs, seasonID);
220-
end
221-
table.sort(orderedSeasonIDs);
222219
--- @param rootDescription RootMenuDescriptionProxy
223220
seasonDropdown:SetupMenu(function(_, rootDescription)
221+
local orderedSeasonIDs = {};
222+
for seasonID, _ in pairs(SEASON_NAMES) do
223+
table.insert(orderedSeasonIDs, seasonID);
224+
end
225+
table.sort(orderedSeasonIDs);
224226
for _, seasonID in ipairs(orderedSeasonIDs) do
225227
rootDescription:CreateRadio(
226228
SEASON_NAMES[seasonID],
@@ -570,7 +572,9 @@ function UI:CreateOutfitSlashCommand(tier)
570572
end
571573
itemTransmogInfoList[INVSLOT_MAINHAND] = ItemUtil.CreateItemTransmogInfo(4231); -- Knuckleduster, smallest I could find
572574

573-
return TransmogUtil.CreateOutfitSlashCommand(itemTransmogInfoList);
575+
local func = TransmogUtil.CreateCustomSetSlashCommand or TransmogUtil.CreateOutfitSlashCommand;
576+
577+
return func(itemTransmogInfoList);
574578
end
575579

576580
function UI:DeferUpdateItems()

0 commit comments

Comments
 (0)