diff --git a/.luacheckrc b/.luacheckrc index a0c4b33..e80b9d3 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -1832,6 +1832,7 @@ stds.wow = { "LFG_LIST_DIFFICULTY", "LOCKED", "LOOT_NOUN", + "MAJOR_FACTION_BUTTON_FACTION_LOCKED", "MAJOR_FACTION_BUTTON_RENOWN_LEVEL", "MAJOR_FACTION_LIST_TITLE", "MAJOR_FACTION_MAX_RENOWN_REACHED", diff --git a/API.lua b/API.lua index 2185147..018f11d 100644 --- a/API.lua +++ b/API.lua @@ -1511,6 +1511,16 @@ do -- Map }; C_Map.SetUserWaypoint(point); end + + function API.OpenWorldMap(uiMapID) + if not InCombatLockdown() then + if (not uiMapID) or (uiMapID and GetMapInfo(uiMapID)) then + C_Map.OpenWorldMap(uiMapID); + return true; + end + end + return false; + end end do -- Instance -- Map @@ -4291,12 +4301,16 @@ do -- Macro Util end function API.GetPetNameAndUsability(speciesID, checkUsability) - local name = WoWAPI.GetPetInfoBySpeciesID(speciesID); - if checkUsability then - local _, petGUID = WoWAPI.FindPetIDByName(name); - return name, petGUID ~= nil - else - return name + local name = speciesID and WoWAPI.GetPetInfoBySpeciesID(speciesID); + if type(name) == "string" then + -- C_PetJournal.GetPetInfoBySpeciesID returns the function itself and the argument when no pet was found. WTF? + -- /dump C_PetJournal.GetPetInfoBySpeciesID(1) == C_PetJournal.GetPetInfoBySpeciesID + if checkUsability then + local _, petGUID = WoWAPI.FindPetIDByName(name); + return name, petGUID ~= nil + else + return name + end end end end diff --git a/Art/ExpansionLandingPage/MajorFactionIcons.png b/Art/ExpansionLandingPage/MajorFactionIcons.png index 26668e4..164aabc 100644 Binary files a/Art/ExpansionLandingPage/MajorFactionIcons.png and b/Art/ExpansionLandingPage/MajorFactionIcons.png differ diff --git a/Art/ExpansionLandingPage/PlayerPowerCard.png b/Art/ExpansionLandingPage/PlayerPowerCard.png new file mode 100644 index 0000000..88dae1e Binary files /dev/null and b/Art/ExpansionLandingPage/PlayerPowerCard.png differ diff --git a/Art/MapPin/PreyQuestDifficulty.png b/Art/MapPin/PreyQuestDifficulty.png index 3a6f608..1c63ab3 100644 Binary files a/Art/MapPin/PreyQuestDifficulty.png and b/Art/MapPin/PreyQuestDifficulty.png differ diff --git a/Initialization.lua b/Initialization.lua index 3488d29..771c2b8 100644 --- a/Initialization.lua +++ b/Initialization.lua @@ -1,5 +1,5 @@ -local VERSION_TEXT = "1.9.3 c"; -local VERSION_DATE = 1783000000; +local VERSION_TEXT = "1.9.4"; +local VERSION_DATE = 1786300000; local addonName, addon = ... @@ -572,6 +572,7 @@ do addon.IS_MOP = C_AddOns.GetAddOnMetadata(addonName, "X-Expansion") == "MOP"; addon.IS_12_0_7 = IsToCVersionEqualOrNewerThan(120007); + addon.IS_12_1_0 = IsToCVersionEqualOrNewerThan(120100); function addon.GetLastLoginTime() diff --git a/Locales/enUS.lua b/Locales/enUS.lua index 28b9c0a..f5096e6 100755 --- a/Locales/enUS.lua +++ b/Locales/enUS.lua @@ -658,6 +658,7 @@ L["Drawer Option Update Frequently Tooltip"] = "Attempt to update the button sta L["ModuleName DrawerMacro"] = "Drawer Macro"; L["ModuleDescription DrawerMacro"] = "Create a custom flyout menu to manage your items, spells, pets, mounts, toys.\n\nTo make a Drawer Macro, create a new macro first, then enter |cffd7c0a3#plumber:drawer|r in the command editbox."; L["No Slot For New Character Macro Alert"] = "You need to have a spare Character Specific Macro slot to complete this action."; +L["Unknown Pet"] = "Unknown Pet"; --New Expansion Landing Page @@ -674,6 +675,7 @@ L["Not On Quest"] = "You are not on this quest"; L["Factions"] = "Factions"; L["Activities"] = MAP_LEGEND_CATEGORY_ACTIVITIES or "Activities"; L["Raids"] = RAIDS or "Raids"; +L["Player Power"] = "Powers"; L["Instruction Track Achievement"] = ""; L["Instruction Untrack Achievement"] = CONTENT_TRACKING_UNTRACK_TOOLTIP_PROMPT or ""; L["No Data"] = "No data"; @@ -743,6 +745,7 @@ L["Near Completion Tooltip"] = "This entry is visible to you because you are abo L["Inactive Currencies Tooltip"] = "These currencies are hidden because you have set them as Unused:"; L["New Quest"] = "New Quest"; L["Trait Points Available"] = "Points Available"; +L["Unspent Points"] = "Unspent Points"; --ExpansionSummaryMinimapButton @@ -909,6 +912,7 @@ L["ModuleDescription CatalystUI"] = "Allows you to Ctrl-Click the output item to L["ModuleName HuntTable"] = "Prey: Hunt Table"; L["ModuleDescription HuntTable"] = "- Replaces the generic blue quest icons to show difficulties.\n\n- Shows an indicator if the Prey target is a requirement for an unearned achievement."; L["Prey Target Has Achievement"] = "This Prey target is a requirement for an unearned achievement."; +L["Quest Objective Entry Format"] = "Quest objective for: %s"; --PreyQuestSuperTrack diff --git a/Locales/zhCN.lua b/Locales/zhCN.lua index 751833d..372078f 100755 --- a/Locales/zhCN.lua +++ b/Locales/zhCN.lua @@ -658,6 +658,7 @@ L["Drawer Option Update Frequently Tooltip"] = "在你背包或法术书发生 L["ModuleName DrawerMacro"] = "技能收纳宏"; L["ModuleDescription DrawerMacro"] = "创建自定义弹出菜单来整理你的物品、法术、宠物、坐骑、玩具。\n\n要创建技能收纳宏, 请先创建一个新宏,然后在宏编辑框中输入 |cffd7c0a3#plumber:drawer|r"; L["No Slot For New Character Macro Alert"] = "需要一个空的角色专用宏栏位来完成此操作。"; +L["Unknown Pet"] = "未知小宠物"; --New Expansion Landing Page @@ -674,6 +675,7 @@ L["Not On Quest"] = "你没有接到该任务"; L["Factions"] = "声望总览"; L["Activities"] = "每周活动"; L["Raids"] = "团队副本"; +L["Player Power"] = "战力系统"; L["Instruction Track Achievement"] = "<按住Shift点击追踪此成就>"; L["Instruction Untrack Achievement"] = "<按住Shift点击取消追踪>"; L["No Data"] = "没有数据"; @@ -712,6 +714,7 @@ L["Near Completion Tooltip"] = "你可以看见此条目是因为你即将达到 L["Inactive Currencies Tooltip"] = "以下货币因为被你设为“未使用”而隐藏:"; L["New Quest"] = "新任务"; L["Trait Points Available"] = "可分配点数"; +L["Unspent Points"] = "你有待分配的点数"; --ExpansionSummaryMinimapButton @@ -877,6 +880,7 @@ L["ModuleDescription CatalystUI"] = "允许你按住Ctrl点击转化后的装备 L["ModuleName HuntTable"] = "狩猎:狩猎地图"; L["ModuleDescription HuntTable"] = "- 将狩猎地图上的蓝色任务图标替换为难度图标。\n\n- 若狩猎目标与某个未完成的成就相关,在其右上方显示特别标记。"; L["Prey Target Has Achievement"] = "某个未完成的成就要求你击败此目标。"; +L["Quest Objective Entry Format"] = "属于此任务的目标:%s"; --PreyQuestSuperTrack diff --git a/Modules/ControlCenter/Changelog/enUS.lua b/Modules/ControlCenter/Changelog/enUS.lua index 90cb2cf..5077260 100644 --- a/Modules/ControlCenter/Changelog/enUS.lua +++ b/Modules/ControlCenter/Changelog/enUS.lua @@ -7,6 +7,58 @@ local _, addon = ... local L = addon.L; local changelogs = addon.ControlCenter.changelogs; +changelogs[10904] = { + { + type = "date", + versionText = "1.9.4", + timestamp = 1786300000, + }, + + { + type = "h1", + text = L["ModuleName NewExpansionLandingPage"], + }, + + { + type = "p", + bullet = true, + text = "The Omnium Folio has been moved to a separate tab named Powers.", + }, + + { + type = "p", + bullet = true, + text = "New content will appear once patch 12.1 goes live.", + }, + + { + type = "br", + }, + + { + type = "h1", + text = MISCELLANEOUS, + }, + + { + type = "p", + bullet = true, + text = "Plumber Macros: Fixed an error that occurred if the macro contained an invalid pet.", + }, + + { + type = "p", + bullet = true, + text = "Hunt Table: Show a quest mark next to the pin if the Prey target is a quest objective.", + }, + + { + type = "p", + bullet = true, + text = "The module that alleviated the graphics crash by reducing the number of models shown on the Appearance tab has been removed, since a recent NVIDIA driver seems to have fixed it.", + }, +}; + changelogs[10903] = { { type = "date", @@ -2278,142 +2330,3 @@ changelogs[10800] = { text = "Loot Window, Link Item: You can link an item in chat by Shift + clicking an item in Manual Loot mode.", }, }; - - -changelogs[10709] = { - { - type = "date", - versionText = "1.7.9", - timestamp = 1761400000, - }, - - { - type = "h1", - text = L["ModuleName QueueStatus"], - dbKey = "QueueStatus", - }, - - { - type = "Checkbox", - dbKey = "QueueStatus", - }, - - { - type = "p", - bullet = true, - text = "Add a progress bar to the Group Finder Eye that shows the percentage of teammates found. Tanks and Healers weigh more.", - }, - - { - type = "p", - bullet = true, - text = "(Optional) Show the delta between Average Wait Time and your Time In Queue.", - }, - - { - type = "img", - dbKey = "QueueStatus", - }, - - { - type = "br", - }, - - --{ - -- type = "h1", - -- text = L["ModuleName PlayerPing"], - -- dbKey = "WorldMapPin_PlayerPing", - --}, - - --{ - -- type = "Checkbox", - -- dbKey = "WorldMapPin_PlayerPing", - --}, - - --{ - -- type = "p", - -- text = "By default, WoW only shows the player ping when you change maps or the first time you open the World Map. Whereas this module highlights the player's location with a ping effect when you:", - --}, - - --{ - -- type = "p", - -- bullet = true, - -- text = "Open World Map.", - --}, - - --{ - -- type = "p", - -- bullet = true, - -- text = "Press the ALT key.", - --}, - - --{ - -- type = "p", - -- bullet = true, - -- text = "Click the Maximize button.", - --}, - - --{ - -- type = "p", - -- text = "Updated the ping texture", - --}, - - --{ - -- type = "img", - -- dbKey = "WorldMapPin_PlayerPing", - --}, - - --{ - -- type = "br", - --}, - - { - type = "h1", - text = L["ModuleName HolidayDungeon"], - dbKey = "HolidayDungeon", - }, - - { - type = "Checkbox", - dbKey = "HolidayDungeon", - }, - - { - type = "p", - bullet = true, - text = "Automatically select holiday and timewalking dungeons when you open Dungeon Finder for the first time.", - }, - - { - type = "br", - }, - - { - type = "h1", - text = L["New Features"], - }, - - { - type = "p", - bullet = true, - text = "Tooltip: Quest Starting Items: If an item in your bag starts a quest, show the quest details. You can Ctrl Left Click the item to view it in the quest log if you are already on the quest.", - }, - - { - type = "p", - bullet = true, - text = "Non-refundable Purchase Alert: Adjust the confirmation dialog that appears when buying a non-refundable item, adding a brief lockdown to the 'Yes' button and highlighting the keywords in red. This module also reduces the class set conversion delay by half.", - }, - - { - type = "p", - bullet = true, - text = "Legion Remix: Auto-set Adventure Guide expansion to Legion.", - }, - - { - type = "p", - bullet = true, - text = "This module should now support addons that modify the max number of items per page. It also shows thousands separator on alt currencies like Bronze.", - }, -}; diff --git a/Modules/DelvesScenario.lua b/Modules/DelvesScenario.lua index c337995..f4598c2 100644 --- a/Modules/DelvesScenario.lua +++ b/Modules/DelvesScenario.lua @@ -65,6 +65,10 @@ do --Show Enemy Group Count bellow affix spell on the ScenarioHeaderDelves local CURRENCY_AFFIX_ACTIVE = 3103; local CURRENCY_AFFIX_MAXIMUM = 3104; + if addon.IS_12_1_0 then + NEMESIS_SPELL_ID = 1307638; + end + function BonusObjectiveTrackerMixin:OnEvent(event, ...) --Fire CURRENCY_DISPLAY_UPDATE 1/2 times After killing one group, 3103 changed to 0 then the actual number if event == "CURRENCY_DISPLAY_UPDATE" then diff --git a/Modules/ExpansionLandingPage/ActivityTab.lua b/Modules/ExpansionLandingPage/ActivityTab.lua index e999c4e..13bdc59 100644 --- a/Modules/ExpansionLandingPage/ActivityTab.lua +++ b/Modules/ExpansionLandingPage/ActivityTab.lua @@ -2,7 +2,7 @@ local _, addon = ... local API = addon.API; local L = addon.L; local CallbackRegistry = addon.CallbackRegistry; -local LandingPageUtil = addon.LandingPageUtil; +local LandingPageUtil = addon.LandingPageUtil; ---@class LandingPageUtil local ActivityUtil = addon.ActivityUtil; local TooltipUpdator = LandingPageUtil.TooltipUpdator; diff --git a/Modules/ExpansionLandingPage/Basic.lua b/Modules/ExpansionLandingPage/Basic.lua index 1494743..d88cebb 100644 --- a/Modules/ExpansionLandingPage/Basic.lua +++ b/Modules/ExpansionLandingPage/Basic.lua @@ -4,6 +4,7 @@ local API = addon.API; local Mixin = API.Mixin; +---@class LandingPageUtil local LandingPageUtil = {}; addon.LandingPageUtil = LandingPageUtil; @@ -472,12 +473,18 @@ do --TabUtil return tabInfo.frame end - function LandingPageUtil.EnumerateTabInfo() - return ipairs(Tabs); + local function IsTabValid(tabInfo) + return (not tabInfo.validityCheck) or tabInfo.validityCheck(); end - function LandingPageUtil.GetNumTabs() - return #Tabs + function LandingPageUtil.EnumerateValidTabInfo() + local validTabs = {}; + for _, tabInfo in ipairs(Tabs) do + if IsTabValid(tabInfo) then + table.insert(validTabs, tabInfo); + end + end + return ipairs(validTabs); end function LandingPageUtil.SelectTab(tabKey) @@ -485,8 +492,8 @@ do --TabUtil if tabKey then for _, tabInfo in ipairs(Tabs) do if tabInfo.key == tabKey then - valid = true; - break + valid = IsTabValid(tabInfo); + break; end end end @@ -553,14 +560,14 @@ do --Atlas local FACTION_ICONS = "Interface/AddOns/Plumber/Art/ExpansionLandingPage/MajorFactionIcons.png"; local FACTION_ICONS_COORDS = { --[factionID] = {icon l, r, t, b, highlight l, r, t, b} - [2590] = {0 , 128, 0, 128}, --Council of Dornogal - [2594] = {128, 256, 0, 128}, --The Assembly of the Deeps - [2570] = {256, 384, 0, 128}, --Hallowfall Arathi - [2600] = {384, 512, 0, 128}, --Severed Threads - [2653] = {512, 640, 0, 128}, --Cartels of Undermine - [2685] = {640, 768, 0, 128}, --Gallagio Loyalty Rewards Club - [2688] = {768, 896, 0, 128}, --Flame's Radiance - [2658] = {896, 1024, 0, 128}, --The K'aresh Trust + [2590] = {0 , 128, 0, 128}, --Council of Dornogal + [2594] = {128, 256, 0, 128}, --The Assembly of the Deeps + [2570] = {256, 384, 0, 128}, --Hallowfall Arathi + [2600] = {384, 512, 0, 128}, --Severed Threads + [2653] = {512, 640, 0, 128}, --Cartels of Undermine + [2685] = {640, 768, 0, 128}, --Gallagio Loyalty Rewards Club + [2688] = {768, 896, 0, 128}, --Flame's Radiance + [2658] = {896,1024, 0, 128}, --The K'aresh Trust [2736] = {0 , 128, 256, 384}, --Manaforge Vandals [2710] = {128, 256, 256, 384}, --Silvermoon Court @@ -570,9 +577,14 @@ do --Atlas [2764] = {640, 768, 256, 384}, --Prey [2742] = {768, 896, 256, 384}, --Delves - [2792] = {896, 1024, 256, 384}, --Ritual Sites + [2792] = {896,1024, 256, 384}, --Ritual Sites + [2772] = {0 , 128, 512, 640}, --Zul'jarra's Forces }; + FACTION_ICONS_COORDS[2808] = FACTION_ICONS_COORDS[2764]; --Prey S2 + FACTION_ICONS_COORDS[2796] = FACTION_ICONS_COORDS[2742]; --Delves S2 + + local function SetTextureDimension(textureObject, file, width, height, l, r, t, b, useTrilinearFilter) if useTrilinearFilter then textureObject:SetTexture(file, nil, nil, true); @@ -1754,6 +1766,10 @@ do --Expansion Select end end + function LandingPageUtil.GetCurrentExpansionID() + return CurrentExpansionID; + end + function LandingPageUtil.GetAvailableExpansions() return ExpansionList end diff --git a/Modules/ExpansionLandingPage/Currency.lua b/Modules/ExpansionLandingPage/Currency.lua index 010d0e8..ea7f8e8 100644 --- a/Modules/ExpansionLandingPage/Currency.lua +++ b/Modules/ExpansionLandingPage/Currency.lua @@ -2,7 +2,7 @@ local _, addon = ... local API = addon.API; local L = addon.L; local CallbackRegistry = addon.CallbackRegistry; -local LandingPageUtil = addon.LandingPageUtil; +local LandingPageUtil = addon.LandingPageUtil; ---@class LandingPageUtil local IS_MIDNIGHT = addon.IS_MIDNIGHT; diff --git a/Modules/ExpansionLandingPage/EditBox.lua b/Modules/ExpansionLandingPage/EditBox.lua index c1dc044..02f85dc 100644 --- a/Modules/ExpansionLandingPage/EditBox.lua +++ b/Modules/ExpansionLandingPage/EditBox.lua @@ -1,6 +1,6 @@ local _, addon = ... local API = addon.API; -local LandingPageUtil = addon.LandingPageUtil; +local LandingPageUtil = addon.LandingPageUtil; ---@class LandingPageUtil local StringTrim = API.StringTrim; diff --git a/Modules/ExpansionLandingPage/EncounterData.lua b/Modules/ExpansionLandingPage/EncounterData.lua index 91af02a..719bbf7 100644 --- a/Modules/ExpansionLandingPage/EncounterData.lua +++ b/Modules/ExpansionLandingPage/EncounterData.lua @@ -1,7 +1,7 @@ local _, addon = ... local API = addon.API; local L = addon.L; -local LandingPageUtil = addon.LandingPageUtil; +local LandingPageUtil = addon.LandingPageUtil; ---@class LandingPageUtil local ipairs = ipairs; @@ -13,12 +13,23 @@ local PLAYER_CLASS_ID; local EncounterData = { - --[journalEncounterID] = { achv = {Mythic, Special} } + --[journalEncounterID] = { achv = {achievementID1, achievementID2, ...} } + -- achv order: Any Kill, Heroic, Mythic, Special Condition --https://wago.tools/db2/JournalEncounter?page=1 --/dump GetMouseFoci()[1].icon:GetTexture() + [2849] = {icon = 3012069, achv = {63683, 63681, 63682}}, --Nymrissa Wavecaller - [2711] = {icon = 7448202, achv = {63237, 63240, 63241}}, --Rotmire + [2888] = {icon = 7966621, achv = {61372, 63418}}, --Nek'zali the Soulcoiler + [2874] = {icon = 7966620, achv = {63524, 63250}}, --Entombed Sentinels + [2882] = {icon = 7966618, achv = {63526, 63397}}, --Vashnik the Malignant + [2894] = {icon = 7966622, achv = {63525, 63645}}, --The Lost Explorers + [2871] = {icon = 7966619, achv = {63527, 63391}}, --Sszorak + [2887] = {icon = 7966623, achv = {63528, 63656}}, --The Twin Fangs + [2883] = {icon = 7966625, achv = {63529, 63669}}, --The Coiled Altar + [2895] = {icon = 7966624, achv = {63476, 63609}}, --Ula'tek + + [2711] = {icon = 7852823, achv = {63237, 63240, 63241}}, --Rotmire [2795] = {icon = 7448202, achv = {61487, 61488, 61489, 61454}}, --Chimaerus @@ -261,18 +272,10 @@ LandingPageUtil.GetDifficultyName = GetEJDifficultyString; do - local TWW_EncounterTabInfo = { - JournalInstanceIDs = { - 1302, --Manaforge Omega - 1296, --Liberation of Undermine - 1273, --Nerub-ar Palace - --768, --Debug Emerald Nightmare - }, - }; - LandingPageUtil.AddExpansionData(11, "encounter", TWW_EncounterTabInfo); - local MID_EncounterTabInfo = { JournalInstanceIDs = { + 1317, --The Tidebound Grotto + 1320, --The Venomous Abyss 1305, --Sporefall 1314, --The Dreamrift 1307, --The Voidspire @@ -280,4 +283,14 @@ do }, }; LandingPageUtil.AddExpansionData(12, "encounter", MID_EncounterTabInfo); + + local TWW_EncounterTabInfo = { + JournalInstanceIDs = { + 1302, --Manaforge Omega + 1296, --Liberation of Undermine + 1273, --Nerub-ar Palace + --768, --Debug Emerald Nightmare + }, + }; + LandingPageUtil.AddExpansionData(11, "encounter", TWW_EncounterTabInfo); end diff --git a/Modules/ExpansionLandingPage/EncounterJournal.lua b/Modules/ExpansionLandingPage/EncounterJournal.lua index 391a361..44bf1e8 100644 --- a/Modules/ExpansionLandingPage/EncounterJournal.lua +++ b/Modules/ExpansionLandingPage/EncounterJournal.lua @@ -1,7 +1,7 @@ local _, addon = ... local API = addon.API; local L = addon.L; -local LandingPageUtil = addon.LandingPageUtil; +local LandingPageUtil = addon.LandingPageUtil; ---@class LandingPageUtil local GetEncounterProgress = LandingPageUtil.GetEncounterProgress; diff --git a/Modules/ExpansionLandingPage/ExpansionLandingPage.lua b/Modules/ExpansionLandingPage/ExpansionLandingPage.lua index 1b50073..138e85e 100644 --- a/Modules/ExpansionLandingPage/ExpansionLandingPage.lua +++ b/Modules/ExpansionLandingPage/ExpansionLandingPage.lua @@ -1,8 +1,8 @@ local _, addon = ... local API = addon.API; local L = addon.L; +local LandingPageUtil = addon.LandingPageUtil; ---@class LandingPageUtil local CallbackRegistry = addon.CallbackRegistry; -local LandingPageUtil = addon.LandingPageUtil; local IS_MOP = addon.IS_MOP; @@ -279,7 +279,7 @@ do end if LandingPageUtil.HasAnyPurchasableTrait() then - self:ShowTraitTab(); + self:ShowPlayerPowerTab(); end LandingPageUtil.HideMinimapButtonAlert(); @@ -288,12 +288,30 @@ do function PlumberExpansionLandingPageMixin:OnHide() LandingPageUtil.PlayUISound("LandingPageClose"); LandingPageUtil.MainContextMenu:HideMenu(); - LandingPageUtil.HandleTraitTreeCurrencyChanged(1186); + LandingPageUtil.HandleTraitTreeCurrencyChanged(); end function PlumberExpansionLandingPageMixin:InitTabButtons() self.InitTabButtons = nil; + local buttonContainer = self.RightSection.Header; + + self:UpdateTabButtons(); + + local function Header_OnMouseWheel(_, delta) + --Scroll up will go the left tab + LandingPageUtil.SelectTabByDelta(-delta); + self:UpdateTabs(); + end + buttonContainer:SetScript("OnMouseWheel", Header_OnMouseWheel); + + + local ExpansionSelectButton = CreateExpansionSelectButton(buttonContainer); + ExpansionSelectButton:SetPoint("RIGHT", buttonContainer, "RIGHT", -48, -12); + ExpansionSelectButton:Refresh(); + end + + function PlumberExpansionLandingPageMixin:UpdateTabButtons() if not self.TabButtons then self.TabButtons = {}; end @@ -302,14 +320,13 @@ do button:Hide(); end - local button; local buttonWidth; local offsetY = -12; local totalWidth = 46; local buttonContainer = self.RightSection.Header; - for i, tabInfo in LandingPageUtil.EnumerateTabInfo() do - button = self.TabButtons[i]; + for i, tabInfo in LandingPageUtil.EnumerateValidTabInfo() do + local button = self.TabButtons[i]; if not button then button = CreateTabButton(buttonContainer); self.TabButtons[i] = button; @@ -319,35 +336,21 @@ do buttonWidth = API.Round(button:SetName(tabInfo.name)); button:ClearAllPoints(); button:SetPoint("LEFT", buttonContainer, "LEFT", totalWidth, offsetY); + button:Show(); totalWidth = totalWidth + buttonWidth + 0; end - self:UpdateTabButtons(); - - - local function Header_OnMouseWheel(_, delta) - --Scroll up will go the left tab - LandingPageUtil.SelectTabByDelta(-delta); - self:UpdateTabs(); - end - buttonContainer:SetScript("OnMouseWheel", Header_OnMouseWheel); - - - local ExpansionSelectButton = CreateExpansionSelectButton(buttonContainer); - ExpansionSelectButton:SetPoint("RIGHT", buttonContainer, "RIGHT", -48, offsetY); - ExpansionSelectButton:Refresh(); - end - - function PlumberExpansionLandingPageMixin:UpdateTabButtons() local selectedTabKey = LandingPageUtil.GetSelectedTabKey(); for _, button in ipairs(self.TabButtons) do - button:SetSelected(button.tabKey == selectedTabKey); - button:UpdateNotification(); + if button:IsShown() then + button:SetSelected(button.tabKey == selectedTabKey); + button:UpdateNotification(); + end end end function PlumberExpansionLandingPageMixin:RequestUpdateTabButtons() - if self.TabButtons and self:IsVisible() then + if self:IsVisible() then self:UpdateTabButtons(); end end @@ -370,7 +373,7 @@ do local selectedTabKey = LandingPageUtil.GetSelectedTabKey(); local tabContainer = self.RightSection.TabContainer; - for i, tabInfo in LandingPageUtil.EnumerateTabInfo() do + for i, tabInfo in LandingPageUtil.EnumerateValidTabInfo() do if tabInfo.key == selectedTabKey then if not tabInfo.frame then local f = LandingPageUtil.AcquireTabFrame(tabContainer, i); @@ -388,15 +391,10 @@ do local categories = { {name = L["Great Vault"], frameGetter = LandingPageUtil.CreateGreatVaultFrame, validate = API.IsGreatVaultFeatureAvailable}, + {name = L["Item Upgrade"], frameGetter = LandingPageUtil.CreateItemUpgradeFrame}, {name = L["Resources"], frameGetter = LandingPageUtil.CreateCurrencyList}, }; - if addon.IS_12_0_7 then - table.insert(categories, 2, {name = LandingPageUtil.GetTraitSystemName(), frameGetter = LandingPageUtil.CreateTraitFrame}); - else - table.insert(categories, 2, {name = L["Item Upgrade"], frameGetter = LandingPageUtil.CreateItemUpgradeFrame}); - end - local numCategories = #categories; local offsetY = 16; @@ -523,17 +521,14 @@ end do --Open to Tab - function PlumberExpansionLandingPageMixin:ShowTraitTab() + function PlumberExpansionLandingPageMixin:ShowPlayerPowerTab() -- 12.0.7 Only? if not self:IsShown() then self:Show(); end - local selectedTab = LandingPageUtil.GetSelectedTabKey(); - if selectedTab ~= "faction" and selectedTab ~= "activity" then - LandingPageUtil.SelectTab("faction"); - MainFrame:UpdateTabs(); - end LandingPageUtil.SelectExpansion(12); + LandingPageUtil.SelectTab("playerpower"); + MainFrame:UpdateTabs(); end function PlumberExpansionLandingPageMixin:ShowFactionTabWithPendingReward() @@ -571,4 +566,56 @@ do --Shared function LandingPageUtil.GetUIFrameLevel() return MainFrame.LeftSection.DefaultFrame:GetFrameLevel(); end + + local WidgetLevel = {}; + local BlackOverlay; + + --- Raise the widget frameLevel and darken the rest of the UI + --- @param widget any? If nil, hide the blackscreen. + --- @param highlighted boolean? + function LandingPageUtil.HighlightWidget(widget, highlighted) + for w, oldLevel in pairs(WidgetLevel) do + w:SetFrameLevel(oldLevel); + end + + if not widget then + if BlackOverlay then + BlackOverlay:Hide(); + end + return; + end + + if highlighted then + if not BlackOverlay then + local offset = 8; + local alpha = 0.8; + + BlackOverlay = CreateFrame("Frame", nil, MainFrame); + + local function CreateOverlay(container) + local overlay = BlackOverlay:CreateTexture(nil, "BACKGROUND"); + overlay:SetColorTexture(0, 0, 0, alpha); + overlay:SetPoint("TOPLEFT", container, "TOPLEFT", offset, -offset); + overlay:SetPoint("BOTTOMRIGHT", container, "BOTTOMRIGHT", -offset, offset); + return overlay; + end + + local overlay1 = CreateOverlay(MainFrame.LeftSection); + local overlay2 = CreateOverlay(MainFrame.RightSection); + end + + WidgetLevel = { + [widget] = widget:GetFrameLevel(), + }; + + local baseFrameLevel = 1208; + widget:SetFrameLevel(baseFrameLevel + 10); + BlackOverlay:SetFrameLevel(baseFrameLevel); + BlackOverlay:Show(); + else + if BlackOverlay and WidgetLevel[widget] then + BlackOverlay:Hide(); + end + end + end end diff --git a/Modules/ExpansionLandingPage/ExpansionLandingPage_Retail.xml b/Modules/ExpansionLandingPage/ExpansionLandingPage_Retail.xml index e9a78e5..13aea66 100644 --- a/Modules/ExpansionLandingPage/ExpansionLandingPage_Retail.xml +++ b/Modules/ExpansionLandingPage/ExpansionLandingPage_Retail.xml @@ -20,6 +20,7 @@