diff --git a/.luacheckrc b/.luacheckrc index 7c1b155..ccca9ee 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -86,7 +86,6 @@ read_globals = { "HousingDashboardFrame", "MenuUtil", "StaticPopup_Show", - "StaticPopupDialogs", "CANCEL", "HousingFramesUtil", "GetMouseButtonClicked", @@ -189,6 +188,9 @@ read_globals = { -- Constants "Enum", + "WOW_PROJECT_ID", + "WOW_PROJECT_FOREVER", + "WOW_PROJECT_CAMELOT", "LE_EXPANSION_WAR_WITHIN", "LE_EXPANSION_SHADOWLANDS", "LE_EXPANSION_DRAGONFLIGHT", diff --git a/Bridge/Context.lua b/Bridge/Context.lua index 0e78b67..24b4128 100644 --- a/Bridge/Context.lua +++ b/Bridge/Context.lua @@ -124,7 +124,8 @@ end ---@param includeDetails boolean|nil Load run history and raid lockouts for tooltips ---@return VaultContext function Context:BuildVaultContext(categoryID, includeDetails) - local activities = C_WeeklyRewards.GetActivities(categoryID) or {} + -- Forever has no Great Vault; a missing API simply means no activities. + local activities = C_WeeklyRewards and C_WeeklyRewards.GetActivities(categoryID) or {} -- Sort by index for consistent ordering table.sort(activities, function(a, b) @@ -139,7 +140,7 @@ function Context:BuildVaultContext(categoryID, includeDetails) } -- Get M+ run history for dungeons - if includeDetails and categoryID == 1 then + if includeDetails and categoryID == 1 and C_MythicPlus and C_ChallengeMode then local runs = C_MythicPlus.GetRunHistory(false, false) if runs then -- Add map names diff --git a/CHANGELOG.md b/CHANGELOG.md index 54d1b56..e2dc93a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,17 @@ All notable changes to Weekly will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [Unreleased] + +### Added + +- World of Warcraft: Forever support: the manifest accepts Interface 16001, the loader detects the client flavor, and a Forever launch dataset auto-selects on Forever clients +- Settings only offer datasets that belong to the running client flavor and label Forever datasets as content updates + +### Changed + +- Great Vault, Mythic+, and Journal collection APIs are checked for presence so clients without them load and run without errors + ## [1.3.11] - 2026-09-23 ### Changed diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ecf2e48..92feeaa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,6 +9,7 @@ Thanks for your interest in contributing! Weekly is a lightweight HUD for tracki ``` World of Warcraft\_retail_\Interface\AddOns\Weekly\ ``` + A World of Warcraft: Forever client uses its own `Interface\AddOns` folder; a junction or symlink from one checkout serves both clients 3. **Install validation tools** using the setup below and run `python Tools/validate.py` from the repository root 4. **Restart WoW** for the first installation, then use `/reload` after source edits. Check that the loaded copy is the checkout you are editing diff --git a/ConfigUI.lua b/ConfigUI.lua index 06ef0f1..5c3ec79 100644 --- a/ConfigUI.lua +++ b/ConfigUI.lua @@ -17,6 +17,41 @@ local TRACKABLE_TYPES = { prey = true, } +local function IsForeverClient() + local flavor = ns.Data.GetClientFlavor and ns.Data:GetClientFlavor() + return flavor ~= nil and flavor == ns.Data.FLAVOR_FOREVER +end + +local function IsForeverExpansion(expansionID) + return ns.Data.GetExpansionFlavor ~= nil and ns.Data:GetExpansionFlavor(expansionID) == ns.Data.FLAVOR_FOREVER +end + +local function GetExpansionName(expansionID) + if expansionID == 11 then + return L["The War Within"] + elseif expansionID == 12 then + return L["Midnight"] + elseif IsForeverExpansion(expansionID) then + return L["World of Warcraft: Forever"] + end + return L["Expansion %d"]:format(expansionID) +end + +local function GetSeasonName(expansionID, seasonID) + if seasonID == 3.5 then + return L["Season 3 (Midnight Pre-Patch)"] + elseif IsForeverExpansion(expansionID) then + return L["Content Update %s"]:format(seasonID) + end + return L["Season %s"]:format(seasonID) +end + +-- Only offer datasets that belong to the running client flavor. +local function GetClientExpansions() + local flavor = ns.Data.GetClientFlavor and ns.Data:GetClientFlavor() or nil + return ns.Data:GetExpansions(flavor) +end + local function BuildTrackingArgs() local args = { desc = { @@ -118,16 +153,9 @@ function ConfigUI:Initialize() name = L["Expansion"], order = 1, values = function() - local exps = ns.Data:GetExpansions() local t = { ["auto"] = L["Automatic (Recommended)"] } - for _, id in ipairs(exps) do - if id == 11 then - t[id] = L["The War Within"] - elseif id == 12 then - t[id] = L["Midnight"] - else - t[id] = L["Expansion %d"]:format(id) - end + for _, id in ipairs(GetClientExpansions()) do + t[id] = GetExpansionName(id) end return t end, @@ -151,7 +179,9 @@ function ConfigUI:Initialize() }, season = { type = "select", - name = L["Season"], + name = function() + return IsForeverClient() and L["Content Update"] or L["Season"] + end, order = 2, values = function() local t = { ["auto"] = L["Automatic (Recommended)"] } @@ -167,11 +197,7 @@ function ConfigUI:Initialize() local seasons = ns.Data:GetSeasons(activeExp) for _, id in ipairs(seasons) do - if id == 3.5 then - t[id] = L["Season 3 (Midnight Pre-Patch)"] - else - t[id] = L["Season %s"]:format(id) - end + t[id] = GetSeasonName(activeExp, id) end return t end, @@ -188,11 +214,8 @@ function ConfigUI:Initialize() type = "description", name = function() local exp, sea = ns.Data:GetRecommendedSeason() - local expName = (exp == 11 and L["The War Within"]) - or (exp == 12 and L["Midnight"]) - or (L["Expansion %d"]:format(exp)) - local seaName = (sea == 3.5 and L["Season 3 (Midnight Pre-Patch)"]) - or (L["Season %s"]:format(sea)) + local expName = GetExpansionName(exp) + local seaName = GetSeasonName(exp, sea) local currentStatus = "" if ns.Config.selectedExpansion == "auto" or ns.Config.selectedSeason == "auto" then diff --git a/Core.lua b/Core.lua index 6f7a9c7..ef929be 100644 --- a/Core.lua +++ b/Core.lua @@ -99,12 +99,14 @@ function Weekly:SlashHandler(msg) self:SetDebugEnabled(not (type(ns.Config.debug) == "table" and ns.Config.debug.enabled)) self:Printf(L["Debug Mode: %s"]:format(ns.Config.debug.enabled and "|cff00ff00ON|r" or "|cffff0000OFF|r")) - -- Dump Vault Info + -- Dump Vault Info (the Great Vault does not exist on every client flavor) self:Printf(L["--- DEBUG VAULT (Raid) ---"]) - local acts = C_WeeklyRewards.GetActivities(3) -- Raid + local acts = C_WeeklyRewards and C_WeeklyRewards.GetActivities(3) -- Raid local tierID = nil - if acts then + if not C_WeeklyRewards then + self:Printf(L["Great Vault API unavailable on this client."]) + elseif acts then self:Printf(L["Activities Found: %d"], #acts) for i, act in ipairs(acts) do self:Printf( diff --git a/Data/AGENTS.md b/Data/AGENTS.md index 7184dd4..6a8f8a8 100644 --- a/Data/AGENTS.md +++ b/Data/AGENTS.md @@ -27,7 +27,7 @@ ns.Data:Register(11, 4, data, "Data/ExpansionName/Season4.lua") -- Example: Exp ``` 3. Add the new file to `Weekly.toc` after `Data/Loader.lua` and `Data/Factories.lua`. -4. Update `Data:GetRecommendedSeason()` in `Loader.lua` if the new season should be selected automatically, and cover its build boundary in `Tests/test_data_loader.lua`. +4. Update `Data:GetRecommendedSeason()` in `Loader.lua` if the new season should be selected automatically, and cover its build boundary in `Tests/test_data_loader.lua`. Forever datasets are selected by client flavor rather than by build threshold. ## Sections and Settings @@ -37,7 +37,8 @@ Each dataset is an ordered array of sections with a `title` and an `items` array - `showAfter` and `hideAfter` optionally gate a section using `YYYY-MM-DD` dates at local midnight. Use `Data:IsSectionVisible()` so settings and rendering agree. - Use `Data:GetItemConfigKey(item)` for visibility settings. Keys are namespaced by type; placeholder IDs (`0`) use the label. An explicit `key` provides a stable identity for composite trackers. - Unknown quest IDs must use `Factory.PlaceholderQuest(label, icon, coords)`. A bare `Quest(0, ...)` fails dataset validation, keeping placeholders explicit and searchable. -- Expansion IDs in this registry use addon numbering (11 = The War Within, 12 = Midnight), not the zero-based IDs returned by item APIs. +- Expansion IDs in this registry use addon numbering (1 = World of Warcraft: Forever, 11 = The War Within, 12 = Midnight), not the zero-based IDs returned by item APIs. +- Each expansion belongs to a client flavor (`Data:GetExpansionFlavor()`). Forever datasets live under `Data/Forever/` and are the only ones offered on Forever clients. Forever has no Great Vault, so its datasets must not use `Factory.Vault`; its "season" slot numbers content updates. `Data/Validation.lua` provides pure-Lua schema checks for tooling and tests. It validates every registered season, including array shape, tracker requirements, time gates, coordinates, and settings-key collisions. Keep it out of refresh paths; call `ns.Data:ValidateRegistry()` after all season files have loaded. diff --git a/Data/Forever/Season1.lua b/Data/Forever/Season1.lua new file mode 100644 index 0000000..c7ff2e8 --- /dev/null +++ b/Data/Forever/Season1.lua @@ -0,0 +1,37 @@ +local _, ns = ... + +-------------------------------------------------------------------------------- +-- World of Warcraft: Forever - Launch (Expansion 1, Content Update 1, 1.60.x) +-- +-- Forever ships content updates rather than seasons; the registry's season slot +-- numbers those updates. Forever has no Great Vault or Mythic+, so this dataset +-- must never use Factory.Vault. Weekly objectives, currency IDs, and raid +-- lockouts (raids open 2026-12-09) need in-game confirmation after the +-- 2026-11-04 launch. +-- +-- Merchant's Favor is confirmed in the beta client (Waylaid Supplies turn-ins +-- for Azeroth Commerce Authority / Durotar Supply and Logistics). ID 3402 was +-- confirmed in the beta client on 2026-09-21. Its cap is unknown, so it uses a +-- plain currency row rather than Cap. +-------------------------------------------------------------------------------- + +local Factory = ns.DataFactory +local Currency, PlaceholderQuest = Factory.Currency, Factory.PlaceholderQuest + +local data = { + { + title = "Currencies", + items = { + Currency(3402, "Merchant's Favor"), + }, + }, + { + title = "Forever", + noSort = true, + items = { + PlaceholderQuest("Weekly objectives arrive with the November 4 launch", "Interface\\GossipFrame\\AvailableQuestIcon"), + }, + }, +} + +ns.Data:Register(ns.Data.FOREVER_EXPANSION, 1, data, "Data/Forever/Season1.lua") diff --git a/Data/Loader.lua b/Data/Loader.lua index 25a3b2a..d2ba716 100644 --- a/Data/Loader.lua +++ b/Data/Loader.lua @@ -5,6 +5,38 @@ ns.Data = ns.Data or {} ns.Data.Registry = {} ns.Data.Sources = {} +-- Client flavors. World of Warcraft: Forever runs on the modern client with a +-- 1.60+ build line, so its datasets share this schema but must never be +-- auto-selected on Retail (and vice versa). +ns.Data.FLAVOR_MAINLINE = "mainline" +ns.Data.FLAVOR_FOREVER = "forever" +ns.Data.FOREVER_EXPANSION = 1 + +--- Detect which client flavor is running. +-- Prefers a project constant when the client exposes one, then falls back to +-- the build line: Forever builds are 1.60.x (16000+) while Classic Era stays +-- on 1.15.x, so the range is unambiguous. +-- @return string: ns.Data.FLAVOR_FOREVER or ns.Data.FLAVOR_MAINLINE +function ns.Data:GetClientFlavor() + local foreverProject = WOW_PROJECT_FOREVER or WOW_PROJECT_CAMELOT + if foreverProject and WOW_PROJECT_ID == foreverProject then + return self.FLAVOR_FOREVER + end + local _, _, _, tocversion = GetBuildInfo() + if type(tocversion) == "number" and tocversion >= 16000 and tocversion < 20000 then + return self.FLAVOR_FOREVER + end + return self.FLAVOR_MAINLINE +end + +--- Flavor that owns a registered expansion ID. +function ns.Data:GetExpansionFlavor(expansionID) + if expansionID == self.FOREVER_EXPANSION then + return self.FLAVOR_FOREVER + end + return self.FLAVOR_MAINLINE +end + local parsedDates = {} local function ParseDate(dateStr) @@ -81,6 +113,12 @@ end --- Get the recommended expansion and season based on client version function ns.Data:GetRecommendedSeason() + -- Forever ships content updates instead of seasons. Its build line (1.60.x) + -- sits below every Retail threshold, so resolve the flavor first. + if self:GetClientFlavor() == self.FLAVOR_FOREVER then + return self.FOREVER_EXPANSION, 1 + end + local _, _, _, tocversion = GetBuildInfo() -- Expansion 12.1.0+ (Curse of Ula'tek / Midnight Season 2) @@ -112,10 +150,13 @@ function ns.Data:Get(expansionID, seasonID) end --- Get all registered expansions (for Config) -function ns.Data:GetExpansions() +-- @param flavor string|nil: Only expansions owned by this client flavor +function ns.Data:GetExpansions(flavor) local exps = {} for id, _ in pairs(self.Registry) do - table.insert(exps, id) + if flavor == nil or self:GetExpansionFlavor(id) == flavor then + table.insert(exps, id) + end end table.sort(exps) return exps diff --git a/Dev/Discovery.lua b/Dev/Discovery.lua index a584f37..cfa59db 100644 --- a/Dev/Discovery.lua +++ b/Dev/Discovery.lua @@ -98,6 +98,18 @@ local function GetCurrentZoneInfo() } end +-- Forever quests report no expansion and its reworked zones are not in the +-- retail continent table, so label them by client flavor instead of "nil". +local function ResolveExpansionName(expansion) + if expansion ~= nil then + return ns.TrackerCore.GetExpansionName(expansion) + end + if ns.Data and ns.Data.GetClientFlavor and ns.Data:GetClientFlavor() == ns.Data.FLAVOR_FOREVER then + return "Forever" + end + return nil +end + -------------------------------------------------------------------------------- -- Persistence: Save/Load discovered items -------------------------------------------------------------------------------- @@ -355,7 +367,7 @@ function Discovery:OnCurrencyUpdate(currencyID, _quantity, _quantityChange) name = info.name, icon = info.iconFileID, expansion = expansion, - expansionName = ns.TrackerCore.GetExpansionName(expansion), + expansionName = ResolveExpansionName(expansion), hasCap = hasCap, hasMax = hasMax, maxWeekly = info.maxWeeklyQuantity, @@ -419,7 +431,7 @@ function Discovery:OnQuestEvent(questID, eventType) self.tracker:LogItem("quest", questID, { name = questName, expansion = expansion, - expansionName = ns.TrackerCore.GetExpansionName(expansion), + expansionName = ResolveExpansionName(expansion), eventType = eventType, isWeekly = isWeekly, isDaily = isDaily, diff --git a/Docs/development.md b/Docs/development.md index 0c8b8a6..4b2e74d 100644 --- a/Docs/development.md +++ b/Docs/development.md @@ -40,6 +40,8 @@ The migration helper returns false without running steps for unknown or future s The dataset tests read ordered `Data/*.lua` entries from `Weekly.toc`, then validate the entire registry. Adding a new season to the TOC automatically includes it in these tests. The static validator also rejects a `Data/*/Season*.lua` file omitted from the TOC. +One manifest serves both Retail and World of Warcraft: Forever (`## Interface: 120100, 16001`). All datasets load on both clients; `Data:GetClientFlavor()` decides which flavor is running (a Forever project constant if the client exposes one, otherwise the 1.60+ build line), `Data:GetRecommendedSeason()` resolves the flavor before any Retail build threshold, and settings list only the running flavor's expansions. Game APIs that a flavor lacks, such as the Great Vault, Mythic+, battle pets, toys, and housing, are checked for presence rather than assumed. + Use `Factory.PlaceholderQuest` for unconfirmed IDs rather than `Quest(0, ...)`. The validator checks data structure, required tracker fields, dates, coordinates, and conflicting settings keys without querying the game API. It reports source and row paths and rejects malformed arrays without scanning arbitrary numeric ranges. Validation is invoked by tooling/tests, not by the UI refresh loop. See [Data Management](../Data/AGENTS.md) for the full format. Run `python Tools/validate.py` before submitting changes. CI uses the same command and the tool versions from `Tools/toolchain.json`. It includes both Lua suites, validation-tool tests, localization references, TOC/XML dependencies, release exclusions, orphan seasons, lint, and whitespace checks. See [Contributing](../CONTRIBUTING.md) for installation and executable overrides. diff --git a/Journal/Journal.lua b/Journal/Journal.lua index e65f3ec..611dbfa 100644 --- a/Journal/Journal.lua +++ b/Journal/Journal.lua @@ -496,13 +496,10 @@ function Journal:Initialize() LoadJournalData() end - -- Register events - self.tracker:RegisterEvents({ + -- Register events. Collection APIs vary by client flavor (Forever has no + -- battle pets, toys, or housing), so only subscribe to what exists here. + local events = { ACHIEVEMENT_EARNED = ResetAware(OnAchievementEarned), - NEW_MOUNT_ADDED = ResetAware(OnNewMountAdded), - NEW_PET_ADDED = ResetAware(OnNewPetAdded), - NEW_TOY_ADDED = ResetAware(OnNewToyAdded), - HOUSE_DECOR_ADDED_TO_CHEST = ResetAware(OnDecorAddedToChest), CHAT_MSG_LOOT = OnChatMsgLoot, GET_ITEM_INFO_RECEIVED = OnItemInfoReceived, @@ -510,7 +507,20 @@ function Journal:Initialize() PLAYER_LOGOUT = function(_tracker, _event) SaveJournalData() end, - }) + } + if C_MountJournal then + events.NEW_MOUNT_ADDED = ResetAware(OnNewMountAdded) + end + if C_PetJournal then + events.NEW_PET_ADDED = ResetAware(OnNewPetAdded) + end + if C_ToyBox then + events.NEW_TOY_ADDED = ResetAware(OnNewToyAdded) + end + if C_HousingDecor then + events.HOUSE_DECOR_ADDED_TO_CHEST = ResetAware(OnDecorAddedToChest) + end + self.tracker:RegisterEvents(events) -- Print status local itemCount = self.tracker.itemCount or 0 diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 58c7133..b481e42 100644 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -30,6 +30,7 @@ L["Saved Instances: %d"] = true L["Raid %d: %s (%s) - Locked: %s"] = true L[" - %s (Killed)"] = true L["--- END DEBUG LOCKOUTS ---"] = true +L["Great Vault API unavailable on this client."] = true -- ConfigUI - General L["General"] = true @@ -42,6 +43,9 @@ L["Expansion %d"] = true L["Season"] = true L["Season 3 (Midnight Pre-Patch)"] = true L["Season %s"] = true +L["World of Warcraft: Forever"] = true +L["Content Update"] = true +L["Content Update %s"] = true L["Currently detecting: %s, %s"] = true L["Sort Completed to Bottom"] = true L["Move completed quests and capped currencies to the bottom of their list."] = true diff --git a/README.md b/README.md index 69ffcdc..d3cdc31 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,15 @@ # Weekly -A lightweight World of Warcraft Retail addon for tracking **Great Vault** progress, **weekly quests**, **currencies**, **bag items**, and **Prey hunts**. Its customizable tracker and Weekly Journal keep weekly objectives and newly earned collectibles in view. +A lightweight World of Warcraft addon for Retail and World of Warcraft: Forever that tracks **Great Vault** progress, **weekly quests**, **currencies**, **bag items**, and **Prey hunts**. Its customizable tracker and Weekly Journal keep weekly objectives and newly earned collectibles in view. -![WoW Version](https://img.shields.io/badge/WoW-Retail-blue) -![Interface](https://img.shields.io/badge/Interface-120100-green) +![WoW Version](https://img.shields.io/badge/WoW-Retail%20%7C%20Forever-blue) +![Interface](https://img.shields.io/badge/Interface-120100%20%7C%2016001-green) [![GitHub](https://img.shields.io/badge/GitHub-Falkicon%2FWeekly-181717?logo=github)](https://github.com/Falkicon/Weekly) [![Sponsor](https://img.shields.io/badge/Sponsor-pink?logo=githubsponsors)](https://github.com/sponsors/Falkicon) -The manifest targets **Interface 120100**. Bundled datasets cover The War Within Season 3 and Midnight Seasons 1 and 2. New Season 2 quest IDs are marked as PTR candidates in the data file and still need in-game confirmation. +The manifest targets **Interface 120100** (Retail) and **16001** (World of Warcraft: Forever). Bundled datasets cover The War Within Season 3, Midnight Seasons 1 and 2, and a Forever launch placeholder. New Season 2 quest IDs are marked as PTR candidates in the data file and still need in-game confirmation. + +On Forever, Weekly detects the client flavor, auto-selects the Forever dataset, and offers only Forever datasets in settings. Forever has no Great Vault or Mythic+, so those rows never appear there; the Journal records only the collection types the client exposes. Forever weekly objectives and raid lockouts will be added once the game launches and its IDs can be confirmed in-game. ## Features @@ -30,6 +32,7 @@ The manifest targets **Interface 120100**. Bundled datasets cover The War Within ``` World of Warcraft\_retail_\Interface\AddOns\ ``` + For World of Warcraft: Forever, use that client's own `Interface\AddOns` folder instead (the beta installs as `_classic_beta_`) 3. Restart WoW after a new installation and enable Weekly in the AddOns list. Use `/reload` after updating an already loaded copy For a source checkout and development tools, see [Contributing](CONTRIBUTING.md). @@ -76,7 +79,7 @@ Use `/weekly settings`, or choose settings from the Journal minimap icon's conte ## Requirements -- A Retail client compatible with the manifest's Interface 120100 target +- A Retail client compatible with the manifest's Interface 120100 target, or a World of Warcraft: Forever client (Interface 16001) - Required libraries are included; FenCore and Mechanic are optional integrations Older season datasets remain selectable; their inclusion does not establish support for older clients. @@ -108,6 +111,7 @@ Older season datasets remain selectable; their inclusion does not establish supp - **Ace3 Framework** – Uses AceAddon, AceDB, AceConfig for robust infrastructure - **Data-Driven** – Centralized `Data/` folder allows easy seasonal updates - **Auto-Selection** – Uses client Interface build thresholds, including PTR builds, rather than a live season calendar. Choose a season explicitly in settings to override it +- **Client Flavors** – `Data:GetClientFlavor()` distinguishes Retail from Forever by project constant or the 1.60+ build line; each dataset belongs to a flavor and only the running flavor's datasets are offered - **Auto-Sizing Layout** – Window calculates height/width based on content - **LibDataBroker** – Minimap and panel integration diff --git a/Tests/test_data_loader.lua b/Tests/test_data_loader.lua index af4f8f2..ce87bcc 100644 --- a/Tests/test_data_loader.lua +++ b/Tests/test_data_loader.lua @@ -93,6 +93,58 @@ describe("Weekly Data Loader", function() assert.are.equal(2, sea) end) + it("should detect the Forever flavor from a 1.60 build line", function() + _G.GetBuildInfo = function() + return "1.60.1", "69893", "Sep 17 2026", 16001 + end + assert.are.equal(ns.Data.FLAVOR_FOREVER, ns.Data:GetClientFlavor()) + + _G.GetBuildInfo = function() + return "12.1.0", "12345", "Aug 2026", 120100 + end + assert.are.equal(ns.Data.FLAVOR_MAINLINE, ns.Data:GetClientFlavor()) + end) + + it("should not mistake a Classic Era build line for Forever", function() + _G.GetBuildInfo = function() + return "1.15.9", "12345", "Aug 2026", 11509 + end + assert.are.equal(ns.Data.FLAVOR_MAINLINE, ns.Data:GetClientFlavor()) + end) + + it("should prefer a Forever project constant when the client exposes one", function() + _G.WOW_PROJECT_ID = 27 + _G.WOW_PROJECT_FOREVER = 27 + _G.GetBuildInfo = function() + return "12.1.0", "12345", "Aug 2026", 120100 + end + assert.are.equal(ns.Data.FLAVOR_FOREVER, ns.Data:GetClientFlavor()) + + _G.WOW_PROJECT_ID = 1 + assert.are.equal(ns.Data.FLAVOR_MAINLINE, ns.Data:GetClientFlavor()) + _G.WOW_PROJECT_ID = nil + _G.WOW_PROJECT_FOREVER = nil + end) + + it("should select the Forever launch dataset on Forever clients", function() + _G.GetBuildInfo = function() + return "1.60.1", "69893", "Sep 17 2026", 16001 + end + + local exp, sea = ns.Data:GetRecommendedSeason() + assert.are.equal(ns.Data.FOREVER_EXPANSION, exp) + assert.are.equal(1, sea) + end) + + it("should filter registered expansions by client flavor", function() + ns.Data:Register(ns.Data.FOREVER_EXPANSION, 1, {}) + ns.Data:Register(12, 2, {}) + + assert.are.same({ ns.Data.FOREVER_EXPANSION, 12 }, ns.Data:GetExpansions()) + assert.are.same({ ns.Data.FOREVER_EXPANSION }, ns.Data:GetExpansions(ns.Data.FLAVOR_FOREVER)) + assert.are.same({ 12 }, ns.Data:GetExpansions(ns.Data.FLAVOR_MAINLINE)) + end) + it("should expose the Season 2 cache objective separately from the 15-hunt ledger", function() LoadFile("Data/Factories.lua") LoadFile("Data/Midnight/Season2.lua") diff --git a/Tests/test_data_validation.lua b/Tests/test_data_validation.lua index d8ad301..8d399e7 100644 --- a/Tests/test_data_validation.lua +++ b/Tests/test_data_validation.lua @@ -61,6 +61,7 @@ describe("Weekly season data validation", function() it("resolves registered data at every recommended-season build boundary", function() local boundaries = { + { build = 16001, expansion = 1, season = 1 }, { build = 119999, expansion = 11, season = 3 }, { build = 120000, expansion = 11, season = 3 }, { build = 120001, expansion = 12, season = 1 }, diff --git a/TrackerCore.lua b/TrackerCore.lua index 768999a..bac2ac9 100644 --- a/TrackerCore.lua +++ b/TrackerCore.lua @@ -397,6 +397,9 @@ local EXPANSION_NAMES = { -- @param expansionID number -- @return string function TrackerCore.GetExpansionName(expansionID) + if expansionID == nil then + return "Unknown" + end return EXPANSION_NAMES[expansionID] or ("Expansion " .. tostring(expansionID)) end diff --git a/Weekly.toc b/Weekly.toc index 8cee563..ff5f4d2 100644 --- a/Weekly.toc +++ b/Weekly.toc @@ -1,4 +1,4 @@ -## Interface: 120100 +## Interface: 120100, 16001 ## Title: Weekly ## Author: Jason Falk ## Version: 1.3.11 @@ -32,6 +32,7 @@ Data\Factories.lua Data\TheWarWithin\Season3.lua Data\Midnight\Season1.lua Data\Midnight\Season2.lua +Data\Forever\Season1.lua # Configuration Core\ConfigMigrations.lua