diff --git a/Callings/CallingsBoard.lua b/Callings/CallingsBoard.lua index fcf60cd..10ff509 100644 --- a/Callings/CallingsBoard.lua +++ b/Callings/CallingsBoard.lua @@ -64,9 +64,13 @@ function WQT_CallingsBoardMixin:OnLoad() self.lastUpdate = 0; self:UpdateCovenant(); - hooksecurefunc(WorldMapFrame, "OnMapChanged", function() - self:OnMapChanged(WorldMapFrame:GetMapID()); - end) + -- hooksecurefunc(WorldMapFrame, "OnMapChanged", function() + -- self:OnMapChanged(WorldMapFrame:GetMapID()); + -- end) + EventRegistry:RegisterCallback("MapCanvas.MapSet", function(_,mapID) + -- Now we do it modern way. + self:OnMapChanged(mapID); + end); self:RequestUpdate(); end @@ -382,13 +386,9 @@ function WQT_CallingsBoardDisplayMixin:OnEnter() if (self.calling.isLockedToday) then local daysUntilString = ""; - if (GetBuildInfo() < "9.0.5") then - daysUntilString = self.calling:GetDaysUntilNextString(); - else - local days = MAX_CALLINGS - self.calling.index + 1; - daysUntilString = _G["BOUNTY_BOARD_NO_CALLINGS_DAYS_" .. days] or BOUNTY_BOARD_NO_CALLINGS_DAYS_1; - end - + local days = MAX_CALLINGS - self.calling.index + 1; + daysUntilString = _G["BOUNTY_BOARD_NO_CALLINGS_DAYS_" .. days] or BOUNTY_BOARD_NO_CALLINGS_DAYS_1; + GameTooltip:SetOwner(self, "ANCHOR_RIGHT"); GameTooltip:SetText(daysUntilString, HIGHLIGHT_FONT_COLOR:GetRGB()); GameTooltip:Show(); @@ -432,11 +432,3 @@ function WQT_CallingsBoardDisplayMixin:OnClick() end end end - - - - - - - - diff --git a/Callings/CallingsBoard.xml b/Callings/CallingsBoard.xml index 497cf86..6972dea 100644 --- a/Callings/CallingsBoard.xml +++ b/Callings/CallingsBoard.xml @@ -1,4 +1,4 @@ - diff --git a/Data.lua b/Data.lua index a37d0f5..16a73cd 100644 --- a/Data.lua +++ b/Data.lua @@ -145,7 +145,19 @@ local function _DeepWipeTable(t) wipe(t); t = nil; end - +-- /dump WorldMapFrame:GetMapID() +local WQT_DRAGONFLIGHT = { + [2026] = {["x"] = 0.66, ["y"] = 0.09}, -- Forbidden Reach (dracthyr start) + [2151] = {["x"] = 0.66, ["y"] = 0.09}, -- Forbidden Reach + [2112] = {["x"] = 0.55, ["y"] = 0.48}, -- Valdrakken + [2022] = {["x"] = 0.49, ["y"] = 0.35}, -- Waking Shores + [2023] = {["x"] = 0.42, ["y"] = 0.56}, -- Ohn'ahran Plains + [2024] = {["x"] = 0.53, ["y"] = 0.74}, -- Azure Span + [2025] = {["x"] = 0.63, ["y"] = 0.50}, -- Thaldraszus + [2085] = {["x"] = 0.66, ["y"] = 0.57}, -- Primalist Future + [2133] = {["x"] = 0.86, ["y"] = 0.83}, -- Zaralek Cavern + [2200] = {["x"] = 0.31, ["y"] = 0.55}, -- Emerald Dream +} local WQT_SHADOWLANDS = { [1543] = {["x"] = 0.23, ["y"] = 0.13}, -- The Maw [1536] = {["x"] = 0.62, ["y"] = 0.21}, -- Maldraxxus @@ -153,6 +165,8 @@ local WQT_SHADOWLANDS = { [1670] = {["x"] = 0.47, ["y"] = 0.51}, -- Oribos [1533] = {["x"] = 0.71, ["y"] = 0.57}, -- Bastion [1565] = {["x"] = 0.48, ["y"] = 0.80}, -- Ardenweald + [1961] = {["x"] = 0.30, ["y"] = 0.25}, -- Korthia + [1970] = {["x"] = 0.85, ["y"] = 0.80}, -- Zereth Mortis } local WQT_ZANDALAR = { [864] = {["x"] = 0.39, ["y"] = 0.32}, -- Vol'dun @@ -170,6 +184,11 @@ local WQT_KULTIRAS = { [1355] = {["x"] = 0.86, ["y"] = 0.14}, -- Nazjatar [1462] = {["x"] = 0.17, ["y"] = 0.28}, -- Mechagon } +local WQT_LEGION_ARGUS = { + [830] = {["x"] = 0.49, ["y"] = 0.29}, -- Krokuun + [885] = {["x"] = 0.29, ["y"] = 0.71}, -- Antoran Wastes + [882] = {["x"] = 0.80, ["y"] = 0.71}, -- Mac'Aree +} local WQT_LEGION = { [630] = {["x"] = 0.33, ["y"] = 0.58}, -- Azsuna [680] = {["x"] = 0.46, ["y"] = 0.45}, -- Suramar @@ -179,9 +198,7 @@ local WQT_LEGION = { [790] = {["x"] = 0.46, ["y"] = 0.84}, -- Eye of Azshara [646] = {["x"] = 0.54, ["y"] = 0.68}, -- Broken Shore [627] = {["x"] = 0.45, ["y"] = 0.64}, -- Dalaran - [830] = {["x"] = 0.86, ["y"] = 0.15}, -- Krokuun - [885] = {["x"] = 0.86, ["y"] = 0.15}, -- Antoran Wastes - [882] = {["x"] = 0.86, ["y"] = 0.15}, -- Mac'Aree + [905] = {["x"] = 0.86, ["y"] = 0.17}, -- Argus } local WQT_KALIMDOR = { [81] = {["x"] = 0.42, ["y"] = 0.82}, -- Silithus @@ -282,13 +299,37 @@ local WQT_DRAENOR = { } local ZonesByExpansion = { - [LE_EXPANSION_SHADOWLANDS] = { + [LE_EXPANSION_DRAGONFLIGHT] = { + 1978, -- Dragon Isles + 2026, -- Forbidden Reach (dracthyr start) + 2151, -- Forbidden Reach + 2112, -- Valdrakken + 2022, -- Waking Shores + 2023, -- Ohn'ahran Plains + 2024, -- Azure Span + 2025, -- Thaldraszus + 2085, -- Primalist Future + 2133, -- Zaralek Cavern + 2200, -- Emerald Dream + } + ,[LE_EXPANSION_SHADOWLANDS] = { + 1550, -- The Shadowlands 1543, -- The Maw 1536, -- Maldraxxus 1525, -- Revendreth 1670, -- Oribos 1533, -- Bastion 1565, -- Ardenweald + 1701, -- Ardenweald covenant + 1702, -- Ardenweald covenant + 1703, -- Ardenweald covenant + 1707, -- Bastion Covenant + 1708, -- Bastion Covenant + 1699, -- Revendreth Covenant + 1700, -- Revendreth Covenant + 1698, -- Maldraxxus Covenant + 1961, -- Korthia + 1970, -- Zereth Mortis } ,[LE_EXPANSION_BATTLE_FOR_AZEROTH] = { 875, -- Zandalar @@ -348,9 +389,11 @@ local function AddZonesToList(t) end end +AddZonesToList(WQT_DRAGONFLIGHT); AddZonesToList(WQT_SHADOWLANDS); AddZonesToList(WQT_ZANDALAR); AddZonesToList(WQT_KULTIRAS); +AddZonesToList(WQT_LEGION_ARGUS); AddZonesToList(WQT_LEGION); AddZonesToList(WQT_KALIMDOR); AddZonesToList(WQT_EASTERN_KINGDOMS); @@ -374,7 +417,7 @@ _DeepWipeTable(ZonesByExpansion); _V["PATH_CUSTOM_ICONS"] = "Interface/Addons/WorldQuestTab/Images/CustomIcons"; _V["LIST_ANCHOR_TYPE"] = {["flight"] = 1, ["world"] = 2, ["full"] = 3, ["taxi"] = 4}; -_V["CURRENT_EXPANSION"] = LE_EXPANSION_SHADOWLANDS; +_V["CURRENT_EXPANSION"] = LE_EXPANSION_DRAGONFLIGHT; _V["TOOLTIP_STYLES"] = { ["default"] = {}, @@ -520,6 +563,7 @@ _V["SETTING_CATEGORIES"] = { {["id"]="DEBUG", ["label"] = "Debug"} ,{["id"]="PROFILES", ["label"] = _L["PROFILES"]} ,{["id"]="GENERAL", ["label"] = GENERAL, ["expanded"] = true} + ,{["id"]="GENERAL_DRAGONFLIGHT", ["parentCategory"] = "GENERAL", ["label"] = EXPANSION_NAME9, ["expanded"] = true} ,{["id"]="GENERAL_SHADOWLANDS", ["parentCategory"] = "GENERAL", ["label"] = EXPANSION_NAME8, ["expanded"] = true} ,{["id"]="GENERAL_OLDCONTENT", ["parentCategory"] = "GENERAL", ["label"] = _L["PREVIOUS_EXPANSIONS"]} ,{["id"]="QUESTLIST", ["label"] = _L["QUEST_LIST"]} @@ -579,7 +623,7 @@ _V["SETTING_LIST"] = { {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_RING", ["label"] = RELICSLOT, ["defaultColor"] = _V["WQT_COLOR_RELIC"], ["valueChangedFunc"] = UpdateColorID, ["colorID"] = "rewardRelic", ["getValueFunc"] = GetColorByID }, - {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_RING", ["label"] = ANIMA, ["defaultColor"] = _V["WQT_COLOR_ARTIFACT"], + {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_RING", ["label"] = WORLD_QUEST_REWARD_FILTERS_ANIMA, ["defaultColor"] = _V["WQT_COLOR_ARTIFACT"], ["valueChangedFunc"] = UpdateColorID, ["colorID"] = "rewardAnima", ["getValueFunc"] = GetColorByID }, {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_RING", ["label"] = ITEM_QUALITY6_DESC, ["defaultColor"] = _V["WQT_COLOR_ARTIFACT"], @@ -619,7 +663,7 @@ _V["SETTING_LIST"] = { {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_AMOUNT", ["label"] = RELICSLOT, ["defaultColor"] = WHITE_FONT_COLOR, ["valueChangedFunc"] = UpdateColorID, ["colorID"] = "rewardTextRelic", ["getValueFunc"] = GetColorByID }, - {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_AMOUNT", ["label"] = ANIMA, ["defaultColor"] = GREEN_FONT_COLOR, + {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_AMOUNT", ["label"] = WORLD_QUEST_REWARD_FILTERS_ANIMA, ["defaultColor"] = GREEN_FONT_COLOR, ["valueChangedFunc"] = UpdateColorID, ["colorID"] = "rewardTextAnima", ["getValueFunc"] = GetColorByID }, {["template"] = "WQT_SettingColorTemplate", ["categoryID"] = "COLORS_REWARD_AMOUNT", ["label"] = ITEM_QUALITY6_DESC, ["defaultColor"] = GREEN_FONT_COLOR, @@ -743,15 +787,21 @@ _V["SETTING_LIST"] = { end ,["getValueFunc"] = function() return WQT.settings.list.includeDaily end } - - ,{["template"] = "WQT_SettingCheckboxTemplate", ["categoryID"] = "GENERAL_SHADOWLANDS", ["label"] = _L["CALLINGS_BOARD"], ["tooltip"] = _L["CALLINGS_BOARD_TT"], ["isNew"] = true + ,{["template"] = "WQT_SettingCheckboxTemplate", ["categoryID"] = "GENERAL_DRAGONFLIGHT", ["label"] = _L["GOLD_PURSES"], ["tooltip"] = _L["GOLD_PURSES_TT"], ["isNew"] = true + , ["valueChangedFunc"] = function(value) + WQT.settings.general.df_goldPurses = value; + WQT_WorldQuestFrame.dataProvider:ReloadQuestRewards(); + end + ,["getValueFunc"] = function() return WQT.settings.general.df_goldPurses end + } + ,{["template"] = "WQT_SettingCheckboxTemplate", ["categoryID"] = "GENERAL_SHADOWLANDS", ["label"] = _L["CALLINGS_BOARD"], ["tooltip"] = _L["CALLINGS_BOARD_TT"] , ["valueChangedFunc"] = function(value) WQT.settings.general.sl_callingsBoard = value; WQT_CallingsBoard:UpdateVisibility(); end ,["getValueFunc"] = function() return WQT.settings.general.sl_callingsBoard end } - ,{["template"] = "WQT_SettingCheckboxTemplate", ["categoryID"] = "GENERAL_SHADOWLANDS", ["label"] = _L["GENERIC_ANIMA"], ["tooltip"] = _L["GENERIC_ANIMA_TT"], ["isNew"] = true + ,{["template"] = "WQT_SettingCheckboxTemplate", ["categoryID"] = "GENERAL_SHADOWLANDS", ["label"] = _L["GENERIC_ANIMA"], ["tooltip"] = _L["GENERIC_ANIMA_TT"] , ["valueChangedFunc"] = function(value) WQT.settings.general.sl_genericAnimaIcons = value; WQT_WorldQuestFrame.dataProvider:ReloadQuestRewards(); @@ -998,10 +1048,12 @@ _V["QUESTS_NOT_COUNTING"] = { } _V["NUMBER_ABBREVIATIONS_ASIAN"] = { - {["value"] = 1000000000, ["format"] = _L["NUMBERS_THIRD"]} + {["value"] = 10000000000000, ["format"] = _L["NUMBERS_THIRD"]} + ,{["value"] = 1000000000000, ["format"] = _L["NUMBERS_THIRD"], ["decimal"] = true} + ,{["value"] = 1000000000, ["format"] = _L["NUMBERS_SECOND"]} ,{["value"] = 100000000, ["format"] = _L["NUMBERS_SECOND"], ["decimal"] = true} ,{["value"] = 100000, ["format"] = _L["NUMBERS_FIRST"]} - ,{["value"] = 1000, ["format"] = _L["NUMBERS_FIRST"], ["decimal"] = true} + ,{["value"] = 10000, ["format"] = _L["NUMBERS_FIRST"], ["decimal"] = true} } _V["NUMBER_ABBREVIATIONS"] = { @@ -1030,13 +1082,13 @@ _V["WQT_CVAR_LIST"] = { _V["WQT_TYPEFLAG_LABELS"] = { [2] = {["Default"] = DEFAULT, ["Elite"] = ELITE, ["PvP"] = PVP, ["Petbattle"] = PET_BATTLE_PVP_QUEUE, ["Dungeon"] = TRACKER_HEADER_DUNGEON, ["Raid"] = RAID, ["Profession"] = BATTLE_PET_SOURCE_4, ["Invasion"] = _L["TYPE_INVASION"], ["Assault"] = SPLASH_BATTLEFORAZEROTH_8_1_FEATURE2_TITLE , ["Daily"] = DAILY, ["Threat"] = REPORT_THREAT, ["Bonus"] = SCENARIO_BONUS_LABEL} - ,[3] = {["Item"] = ITEMS, ["Armor"] = WORLD_QUEST_REWARD_FILTERS_EQUIPMENT, ["Gold"] = WORLD_QUEST_REWARD_FILTERS_GOLD, ["Currency"] = CURRENCY, ["Artifact"] = ITEM_QUALITY6_DESC, ["Anima"] = ANIMA, ["Conduits"] = _L["REWARD_CONDUITS"] + ,[3] = {["Item"] = ITEMS, ["Armor"] = WORLD_QUEST_REWARD_FILTERS_EQUIPMENT, ["Gold"] = WORLD_QUEST_REWARD_FILTERS_GOLD, ["Currency"] = CURRENCY, ["Artifact"] = ITEM_QUALITY6_DESC, ["Anima"] = WORLD_QUEST_REWARD_FILTERS_ANIMA, ["Conduits"] = _L["REWARD_CONDUITS"] , ["Relic"] = RELICSLOT, ["None"] = NONE, ["Experience"] = POWER_TYPE_EXPERIENCE, ["Honor"] = HONOR, ["Reputation"] = REPUTATION} }; _V["FILTER_TYPE_OLD_CONTENT"] = { [2] = {["Invasion"] = true, ["Assault"] = true, ["Threat"] = true} - ,[3] = {["Artifact"] = true, ["Relic"] = true} + ,[3] = {["Anima"] = true, ["Conduits"] = true, ["Artifact"] = true, ["Relic"] = true} } _V["WQT_SORT_OPTIONS"] = {[1] = _L["TIME"], [2] = FACTION, [3] = TYPE, [4] = ZONE, [5] = NAME, [6] = REWARD, [7] = QUALITY} @@ -1183,23 +1235,23 @@ _V["REWARD_TYPE_ATLAS"] = { [_V["CONDUIT_SUBTYPE"].potency] = {["texture"] = "soulbinds_tree_conduit_icon_attack", ["scale"] = 1.15}; [_V["CONDUIT_SUBTYPE"].endurance] = {["texture"] = "soulbinds_tree_conduit_icon_protect", ["scale"] = 1.15}; [_V["CONDUIT_SUBTYPE"].finesse] = {["texture"] = "soulbinds_tree_conduit_icon_utility", ["scale"] = 1.15}; - }-- Anima + }-- Conduits } _V["FILTER_FUNCTIONS"] = { [2] = { -- Types - ["PvP"] = function(questInfo, tagInfo) return tagInfo and tagInfo.worldQuestType == Enum.QuestTagType.PvP; end + ["PvP"] = function(questInfo, tagInfo) return tagInfo and (tagInfo.worldQuestType == Enum.QuestTagType.PvP or tagInfo.worldQuestType == Enum.QuestTagType.Bounty); end ,["Petbattle"] = function(questInfo, tagInfo) return tagInfo and tagInfo.worldQuestType == Enum.QuestTagType.PetBattle; end ,["Dungeon"] = function(questInfo, tagInfo) return tagInfo and tagInfo.worldQuestType == Enum.QuestTagType.Dungeon; end ,["Raid"] = function(questInfo, tagInfo) return tagInfo and tagInfo.worldQuestType == Enum.QuestTagType.Raid; end ,["Profession"] = function(questInfo, tagInfo) return tagInfo and tagInfo.worldQuestType == Enum.QuestTagType.Profession; end - ,["Invasion"] = function(questInfo, tagInfo) return tagInfo and tagInfo.worldQuestType == Enum.QuestTagType.Invasion; end + ,["Invasion"] = function(questInfo, tagInfo) return tagInfo and (tagInfo.worldQuestType == Enum.QuestTagType.Invasion or tagInfo.worldQuestType == Enum.QuestTagType.InvasionWrapper); end ,["Assault"] = function(questInfo, tagInfo) return tagInfo and tagInfo.worldQuestType == Enum.QuestTagType.FactionAssault; end ,["Elite"] = function(questInfo, tagInfo) return tagInfo and tagInfo.isElite and tagInfo.worldQuestType ~= Enum.QuestTagType.Dungeon; end - ,["Default"] = function(questInfo, tagInfo) return tagInfo and not tagInfo.isElite and tagInfo.worldQuestType == Enum.QuestTagType.Normal; end + ,["Default"] = function(questInfo, tagInfo) return tagInfo and ((not tagInfo.isElite and tagInfo.worldQuestType == Enum.QuestTagType.Normal) or tagInfo.worldQuestType == Enum.QuestTagType.DragonRiderRacing or tagInfo.worldQuestType == Enum.QuestTagType.CovenantCalling); end ,["Daily"] = function(questInfo, tagInfo) return questInfo.isDaily; end ,["Threat"] = function(questInfo, tagInfo) return C_QuestLog.IsThreatQuest(questInfo.questId); end - ,["Bonus"] = function(questInfo, tagInfo) return not tagInfo; end + ,["Bonus"] = function(questInfo, tagInfo) return not tagInfo; end } ,[3] = { -- Reward filters ["Armor"] = function(questInfo, tagInfo) return bit.band(questInfo.reward.typeBits, WQT_REWARDTYPE.equipment + WQT_REWARDTYPE.weapon) > 0; end @@ -1216,16 +1268,28 @@ _V["FILTER_FUNCTIONS"] = { ,["None"] = function(questInfo, tagInfo) return questInfo.reward.typeBits == WQT_REWARDTYPE.none; end } }; - +-- /dump WorldMapFrame:GetMapID() +-- /dump FlightMapFrame:GetMapID() _V["WQT_CONTINENT_GROUPS"] = { - [875] = {876} - ,[1011] = {876} -- Zandalar flightmap - ,[876] = {875} - ,[1014] = {875} -- Kul Tiras flightmap + [2200] = {1978,2133} -- Emerald Dream + ,[2241] = {1978,2133} -- Emerald Dream flightmap + ,[2133] = {1978,2200} -- Zaralek Cavern + ,[2175] = {1978,2200} -- Zaralek Cavern flightmap + ,[1978] = {2133,2200} -- Dragonflight + ,[2057] = {2133,2200} -- Dragonflight flightmap + ,[875] = {876, 1355} -- Zandalar + ,[1011] = {876, 1355} -- Zandalar flightmap + ,[876] = {875, 1355} -- Kul Tiras + ,[1014] = {875, 1355} -- Kul Tiras flightmap + ,[1355] = {875, 876} -- Nazjatar ,[1504] = {875, 876} -- Nazjatar flightmap + ,[619] = {905} -- Legion + ,[905] = {619} -- Argus + } _V["ZONE_SUBZONES"] = { + [2025] = {2112, 2085}; -- Thaldraszus, Valdrakken, Primalist Future [1565] = {1701, 1702, 1703}; -- Ardenweald covenant [1533] = {1707, 1708}; -- Bastion Covenant [1525] = {1699, 1700}; -- Revendreth Covenant @@ -1233,7 +1297,15 @@ _V["ZONE_SUBZONES"] = { } _V["WQT_ZONE_MAPCOORDS"] = { - [1647] = WQT_SHADOWLANDS -- Shadowlands flightmap + [2241] = { -- Emerald Dream flightmap + [2200] = {["x"] = 0, ["y"] = 0} -- Emerald Dream + } + ,[2175] = { -- Zaralek Cavern flightmap + [2133] = {["x"] = 0, ["y"] = 0} -- Zaralek Cavern + } + ,[2057] = WQT_DRAGONFLIGHT -- Dragonflight flightmap + ,[1978] = WQT_DRAGONFLIGHT -- Dragonflight + ,[1647] = WQT_SHADOWLANDS -- Shadowlands flightmap ,[1550] = WQT_SHADOWLANDS -- Shadowlands ,[875] = WQT_ZANDALAR -- Zandalar ,[1011] = WQT_ZANDALAR -- Zandalar flightmap @@ -1242,11 +1314,11 @@ _V["WQT_ZONE_MAPCOORDS"] = { ,[1504] = { -- Nazjatar flightmap [1355] = {["x"] = 0, ["y"] = 0} -- Nazjatar } + ,[905] = WQT_LEGION_ARGUS -- Argus ,[619] = WQT_LEGION ,[993] = WQT_LEGION -- Flightmap - ,[905] = WQT_LEGION -- Argus ,[12] = WQT_KALIMDOR - ,[1209] = WQT_KALIMDOR -- Flightmap + ,[1209] = WQT_KALIMDOR -- Flightmap ,[13] = WQT_EASTERN_KINGDOMS ,[1208] = WQT_EASTERN_KINGDOMS -- Flightmap ,[101] = WQT_OUTLAND @@ -1261,11 +1333,19 @@ _V["WQT_ZONE_MAPCOORDS"] = { [210] = {["x"] = 0.42, ["y"] = 0.62} -- Cape ,[50] = {["x"] = 0.67, ["y"] = 0.40} -- North } - ,[947] = { - } -- All of Azeroth + ,[947] = { -- All of Azeroth (Also look at UpdateAzerothZones() in Dataprovider.lua) + [12] = {["x"] = 0.24, ["y"] = 0.55} + ,[13] = {["x"] = 0.89, ["y"] = 0.52} + ,[113] = {["x"] = 0.49, ["y"] = 0.12} + ,[424] = {["x"] = 0.48, ["y"] = 0.82} + ,[619] = {["x"] = 0.58, ["y"] = 0.39} + ,[875] = {["x"] = 0.54, ["y"] = 0.63} + ,[876] = {["x"] = 0.71, ["y"] = 0.50} + ,[1978] = {["x"] = 0.77, ["y"] = 0.22} + } } -_V["WQT_NO_FACTION_DATA"] = { ["expansion"] = 0 ,["playerFaction"] = nil ,["texture"] = 131071, ["name"]=_L["NO_FACTION"] } -- No faction +_V["WQT_NO_FACTION_DATA"] = { ["expansion"] = 0 ,["playerFaction"] = nil ,["texture"] = 1103069, ["name"]=_L["NO_FACTION"] } -- No faction _V["WQT_FACTION_DATA"] = { [67] = { ["expansion"] = LE_EXPANSION_CLASSIC ,["playerFaction"] = nil ,["texture"] = 2203914 } -- Horde ,[469] = { ["expansion"] = LE_EXPANSION_CLASSIC ,["playerFaction"] = nil ,["texture"] = 2203912 } -- Alliance @@ -1302,13 +1382,31 @@ _V["WQT_FACTION_DATA"] = { ,[2400] = { ["expansion"] = LE_EXPANSION_BATTLE_FOR_AZEROTH ,["playerFaction"] = "Alliance" ,["texture"] = 2909043 } -- Waveblade Ankoan ,[2417] = { ["expansion"] = LE_EXPANSION_BATTLE_FOR_AZEROTH ,["playerFaction"] = nil ,["texture"] = 3196264 } -- Uldum Accord ,[2415] = { ["expansion"] = LE_EXPANSION_BATTLE_FOR_AZEROTH ,["playerFaction"] = nil ,["texture"] = 3196265 } -- Rajani - -- Shadowlands - Speculation at this point, I can't test + -- Shadowlands ,[2407] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 3257748 } -- The Ascended ,[2410] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 3641396 } -- The Undying Army ,[2413] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 3257751 } -- Court of Harvesters ,[2465] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 3641394 } -- The Wild Hunt ,[2432] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 3729461 } -- Ve'nari - ,[2470] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 4083292 } -- Death's Advance + ,[2470] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 4083292 } -- Korthia + ,[2472] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 4067928 } -- Korthia Codex + ,[2478] = { ["expansion"] = LE_EXPANSION_SHADOWLANDS,["playerFaction"] = nil ,["texture"] = 4226232 } -- Zereth Mortis + -- LE_EXPANSION_DRAGONFLIGHT + ,[2507] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4687628 } -- Dragonscale Expedition + ,[2511] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4687629 } -- Iskaara Tuskarr + ,[2503] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4687627 } -- Maruuk Centaur + ,[2510] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4687630 } -- Valdrakken Accord + ,[2544] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4548878 } -- Artisan's Consortium + ,[2517] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4640487 } -- Wrathion + ,[2518] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4640488 } -- Sabellian + ,[2550] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 134565 } -- Cobalt Assembly + ,[2523] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4528811 } -- Dark Talons + ,[2524] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4528812 } -- Obsidian Warders + ,[2526] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 4901295 } -- Winterpelt Furbolg + ,[2564] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 5140835 } -- Loamm Niffen + ,[2553] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 609811 } -- Soridormi + ,[2574] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 5244643 } -- Dream Wardens + ,[2615] = { ["expansion"] = LE_EXPANSION_DRAGONFLIGHT,["playerFaction"] = nil ,["texture"] = 5315246 } -- Azerothian Archives } -- Add localized faction names for k, v in pairs(_V["WQT_FACTION_DATA"]) do @@ -1359,7 +1457,7 @@ _V["WQT_DEFAULTS"] = { ["general"] = { sortBy = 1; - fullScreenButtonPos = {["anchor"] = "TOPRIGHT", ["x"] = -74, ["y"] = -2}; + fullScreenButtonPos = {["anchor"] = "TOPRIGHT", ["x"] = -2, ["y"] = -35}; fullScreenContainerPos = {["anchor"] = "TOPLEFT", ["x"] = 0, ["y"] = -25}; defaultTab = false; @@ -1373,7 +1471,7 @@ _V["WQT_DEFAULTS"] = { bountyReward = false; bountySelectedOnly = true; showDisliked = true; - + df_goldPurses = false; sl_callingsBoard = true; sl_genericAnimaIcons = false; @@ -1446,8 +1544,88 @@ end -- This is just easier to maintain than changing the entire string every time _V["PATCH_NOTES"] = { + {["version"] = "10.2.5.0", + ["intro"] = { "Update for 10.2.5." }, + ["new"] ={ + "Added new Dragonflight factions.", + }, + }, + {["version"] = "10.2.0.0", + ["intro"] = { "Update for 10.2.0." }, + ["new"] ={ + "Added new Dragonflight zones and factions.", + }, + ["fixes"] = { + "Updated embedded libraries.", + "Minor fixes.", + }, + }, + {["version"] = "10.1.7.0", + ["intro"] = { "Update for 10.1.7." }, + ["new"] ={ + "Added option to treat Dragonflight dragon racer's purse rewards as gold.", + }, + }, + {["version"] = "10.1.5.0", + ["intro"] = { "Update for 10.1.5." }, + ["changes"] = { + "Added experimental zhCN translation.", + }, + ["fixes"] = { + "Updated embedded libraries.", + }, + }, + {["version"] = "10.1.0.0", + ["intro"] = { "Update for 10.1.0 content." }, + ["new"] ={ + "Added new Dragonflight zones and factions.", + }, + ["fixes"] = { + 'Fixed WQs filtering.', + }, + ["changes"] = { + "Moved full screen button default position.", + }, + }, + {["version"] = "10.0.7.1", + ["fixes"] = { + [[Fixed "Vol'dun" bug.]], + 'Fixed "Elite Ring" size.', + }, + }, + {["version"] = "10.0.7.0", + ["new"] ={ + "Added new Dragonflight zones and factions.", + }, + ["fixes"] = { + 'Fixed "Anima" translation.', + 'Fixed "Shadowlands" submenu in filters dropdown.', + }, + }, + {["version"] = "10.0.2.2", + ["fixes"] = { + 'Fixed "Sparks of Life" bug.', + }, + }, + {["version"] = "10.0.2.1", + ["fixes"] = { + 'Fixed "ShouldHighlightInfo" bug.', + 'Fixed LFG List anchoring to improve compatibility.', + }, + }, + {["version"] = "10.0.2.0", + ["intro"] = { "Update for 10.0.2 content." }, + ["new"] ={ + "Added Dragonflight zones and factions.", + }, + ["fixes"] = { + "Updated embedded libraries.", + "Fixed missing zones and factions.", + "Fixed missing icons.", + }, + }, {["version"] = "9.1.01", - ["intro"] = { "Update for 9.1 content" }, + ["intro"] = { "Update for 9.1 content." }, ["changes"] = { "Changed the calling board progress icons to a texture that looks better at their small scale.", }, diff --git a/Dataprovider.lua b/Dataprovider.lua index 71049e6..4b7c4f9 100644 --- a/Dataprovider.lua +++ b/Dataprovider.lua @@ -24,17 +24,19 @@ local function UpdateAzerothZones(newLevel) wipe(worldTable); -- world map continents depending on expansion level - worldTable[113] = {["x"] = 0.49, ["y"] = 0.13} -- Northrend - worldTable[424] = {["x"] = 0.46, ["y"] = 0.92} -- Pandaria - worldTable[12] = {["x"] = 0.19, ["y"] = 0.5} -- Kalimdor - worldTable[13] = {["x"] = 0.88, ["y"] = 0.56} -- Eastern Kingdom + worldTable[113] = {["x"] = 0.49, ["y"] = 0.12} -- Northrend + worldTable[424] = {["x"] = 0.48, ["y"] = 0.82} -- Pandaria + worldTable[12] = {["x"] = 0.24, ["y"] = 0.55} -- Kalimdor + worldTable[13] = {["x"] = 0.89, ["y"] = 0.52} -- Eastern Kingdom - -- Always take the highest expansion - if (expLevel >= LE_EXPANSION_BATTLE_FOR_AZEROTH and newLevel >= 50) then - worldTable[875] = {["x"] = 0.54, ["y"] = 0.61} -- Zandalar - worldTable[876] = {["x"] = 0.72, ["y"] = 0.49} -- Kul Tiras - elseif (expLevel >= LE_EXPANSION_LEGION and newLevel >= 50) then - worldTable[619] = {["x"] = 0.6, ["y"] = 0.41} -- Broken Isles + -- Always take the highest expansion + if (expLevel >= LE_EXPANSION_DRAGONFLIGHT and newLevel >= 58) then + worldTable[1978] = {["x"] = 0.77, ["y"] = 0.22} -- Dragon Isles + elseif (expLevel >= LE_EXPANSION_BATTLE_FOR_AZEROTH and newLevel >= 50) then + worldTable[875] = {["x"] = 0.54, ["y"] = 0.63} -- Zandalar + worldTable[876] = {["x"] = 0.71, ["y"] = 0.50} -- Kul Tiras + elseif (expLevel >= LE_EXPANSION_LEGION and newLevel >= 45) then + worldTable[619] = {["x"] = 0.58, ["y"] = 0.39} -- Broken Isles end end @@ -238,16 +240,26 @@ function QuestInfoMixin:LoadRewards(force) elseif (typeID == 0 and subTypeID == 8 and price == 0 and ilvl > 100) then -- Item converting into equipment self:AddReward(WQT_REWARDTYPE.equipment, ilvl, texture, quality, WQT_Utils:GetColor(_V["COLOR_IDS"].rewardArmor), rewardId); - else + elseif (rewardId == 199192 or rewardId == 204359 or rewardId == 205226 or rewardId == 210549) and WQT.settings.general.df_goldPurses then + --Treat dragon racer's purse rewards as gold. + self:AddReward(WQT_REWARDTYPE.gold, 525*100*100, 133784, 1, WQT_Utils:GetColor(_V["COLOR_IDS"].rewardGold)); + else self:AddReward(WQT_REWARDTYPE.item, numItems, texture, quality, WQT_Utils:GetColor(_V["COLOR_IDS"].rewardItem), rewardId); end end end end -- Spells - if (GetQuestLogRewardSpell(1, self.questId)) then - local texture, _, _, _, _, _, _, _, rewardId = GetQuestLogRewardSpell(1, self.questId); - self:AddReward(WQT_REWARDTYPE.spell, 1, texture, 1, WQT_Utils:GetColor(_V["COLOR_IDS"].rewardItem), rewardId); + if (C_QuestInfoSystem.HasQuestRewardSpells(self.questId)) then + local spellRewards = C_QuestInfoSystem.GetQuestRewardSpells(self.questId); + for _, spellID in ipairs(spellRewards) do + local spellInfo = C_QuestInfoSystem.GetQuestRewardSpellInfo(self.questId, spellID); + local knownSpell = IsSpellKnownOrOverridesKnown(spellID); + -- only allow the spell reward if user can learn it + if spellInfo and spellInfo.texture and not knownSpell and (not spellInfo.isBoostSpell or IsCharacterNewlyBoosted()) and (not spellInfo.garrFollowerID or not C_Garrison.IsFollowerCollected(spellInfo.garrFollowerID)) then + self:AddReward(WQT_REWARDTYPE.spell, 1, spellInfo.texture, 1, WQT_Utils:GetColor(_V["COLOR_IDS"].rewardItem), spellInfo.spellID); + end + end end -- Honor if (GetQuestLogRewardHonor(self.questId) > 0) then @@ -382,8 +394,9 @@ end function QuestInfoMixin:GetRewardTexture() if (self.reward.typeBits == WQT_REWARDTYPE.none) then - -- Dark empty texture - return "Interface/Garrison/GarrisonMissionUIInfoBoxBackgroundTile"; + -- Dark empty texture + --return "Interface/Garrison/GarrisonMissionUIInfoBoxBackgroundTile"; + return 134400; end local reward = self.rewardList[1]; @@ -478,12 +491,15 @@ function WQT_DataProvider:Init() self.waitingRoomRewards = {}; self.bufferedZones = {}; - hooksecurefunc(WorldMapFrame, "OnMapChanged", function() - -- If we change map, reset the CD, we want new quest info - self:LoadQuestsInZone(WorldMapFrame.mapID); + -- hooksecurefunc(WorldMapFrame, "OnMapChanged", function() + -- -- If we change map, reset the CD, we want new quest info + -- self:LoadQuestsInZone(WorldMapFrame.mapID); + -- end); + EventRegistry:RegisterCallback("MapCanvas.MapSet", function(_,mapID) + -- Now we do it modern way. + self:LoadQuestsInZone(mapID); end); - - UpdateAzerothZones(); + UpdateAzerothZones(); self.updateCD = 0; end @@ -499,7 +515,7 @@ function WQT_DataProvider:OnEvent(event, ...) elseif (event == "PLAYER_LEVEL_UP") then local level = ...; - UpdateAzerothZones(level); + UpdateAzerothZones(level); end end @@ -602,7 +618,7 @@ function WQT_DataProvider:LoadQuestsInZone(zoneID) self.latestZoneId = zoneID -- If the flight map is open, we want all quests no matter what if ((FlightMapFrame and FlightMapFrame:IsShown()) ) then - local taxiId = GetTaxiMapID() + local taxiId = FlightMapFrame and FlightMapFrame:GetMapID() or GetTaxiMapID() zoneID = (taxiId and taxiId > 0) and taxiId or zoneID; -- World Flight Map add-on overwrite if (_WFMLoaded) then @@ -681,6 +697,11 @@ function WQT_DataProvider:AddQuest(qInfo) local questInfo = self.pool:Acquire(); local alwaysHide = not MapUtil.ShouldShowTask(qInfo.mapID, qInfo); + + -- Dragonflight devs forgot to flagged some tech quests with "MapUtil.ShouldShowTask", and past it in Vol'dun location. + -- It make Vol'dun's map messy. This should fix it. + if (qInfo.questId > 60000) and (qInfo.mapID == 864) then alwaysHide = true; end + local posX, posY = WQT_Utils:GetQuestMapLocation(qInfo.questId, qInfo.mapID); local haveRewardData = questInfo:Init(qInfo.questId, qInfo.isDaily, qInfo.isCombatAllyQuest, alwaysHide, posX, posY); diff --git a/Debug.lua b/Debug.lua index 998cf9a..6ae2f23 100644 --- a/Debug.lua +++ b/Debug.lua @@ -167,7 +167,7 @@ local function GetWorldQuestDump() end local function GetPlayerDump() - local version = GetAddOnMetadata(addonName, "version"); + local version = C_AddOns.GetAddOnMetadata(addonName, "version"); local map = C_Map.GetBestMapForUnit("player"); local coords = nil; if (map) then diff --git a/Debug.xml b/Debug.xml index ac549f9..fffbff0 100644 --- a/Debug.xml +++ b/Debug.xml @@ -1,4 +1,4 @@ - diff --git a/External/External.xml b/External/External.xml index ae8f6ae..9bc8dcd 100644 --- a/External/External.xml +++ b/External/External.xml @@ -1,4 +1,4 @@ - diff --git a/Locals.lua b/Locals.lua index 746671d..f4ee5f6 100644 --- a/Locals.lua +++ b/Locals.lua @@ -36,6 +36,8 @@ L["FORMAT_GROUP_SEARCH"] = "Type |cFFFFFFFF%d|r to search for a group for this q L["FORMAT_GROUP_TYPO"] = "It appears to have made a typo. Type either |cFFFFFFFF%d|r, or |cFFFFFFFF%s|r." L["GENERIC_ANIMA"] = "Matching Anima Textures" L["GENERIC_ANIMA_TT"] = "Replace the different anima item textures with matching ones, much like Azerite had. This only affects map icons and the quest list." +L["GOLD_PURSES"] = "Gold Racer's Purses" +L["GOLD_PURSES_TT"] = "Treat Dragon Racer's Purses as gold rewards." L["GROUP_SEARCH_INFO"] = "Blizzard prevents add-ons from automatically looking for a group for the majority of world quests. Because of this, players have to manually fill in the search box." L["INCLUDE_DAILIES"] = "Include Dailies" L["INCLUDE_DAILIES_TT"] = "Treat certain dailies as world quests. Only affects dailies which Blizzard themselves treats as world quests." @@ -473,7 +475,7 @@ L["MAP_FILTER_DISABLED_TITLE"] = "一些世界地图过滤器被禁用" L["NO_FACTION"] = "无阵营" L["NUMBERS_FIRST"] = "%g万" L["NUMBERS_SECOND"] = "%g亿" -L["NUMBERS_THIRD"] = "%g" +L["NUMBERS_THIRD"] = "%g兆" L["PIN_BIGGER"] = "更大的固定项" L["PIN_BIGGER_TT"] = "增大固定项的尺寸来获得更好的可见性" L["PIN_DISABLE"] = "关闭任务图标替换" @@ -520,7 +522,91 @@ L["WHATS_NEW_TT"] = "查看 World Quest Tab 的更新日志。" L["WQT_FULLSCREEN_BUTTON_TT"] = "左键点击来切换世界任务列表,右键按住拖拽来改变位置。" L["PRECISE_FILTER"] = "精确过滤" L["PRECISE_FILTER_TT"] = "过滤器只显示与所有过滤匹配的任务,\\n而不仅仅是单一过滤匹配的任务。" - +L["IGNORES_FILTERS"] = "始终显示" +--Not trusted zhCN translation below this line +L["BLIZZARD"] = "暴雪" +L["CALLINGS_BOARD"] = "使命面板" +L["CALLINGS_BOARD_TT"] = "在地图上显示圣所的使命任务面板,类似以前的大使任务" +L["CURRENT_PROFILE"] = "当前配置文件" +L["CURRENT_PROFILE_TT"] = "选择您启用的配置文件" +L["CUSTOM_COLORS"] = "自定义染色" +L["EMISSARY_REWARD"] = "大使奖励图标" +L["EMISSARY_REWARD_TT"] = "在大使图标上,显示所提供奖励的类型图标" +L["EMISSARY_SELECTED_ONLY"] = "只显示所选大使" +L["EMISSARY_SELECTED_ONLY_TT"] = "只显示所选大使的任务,不再显示其他任务。(关闭此选项,会显示所有现有大使的任务,点一下大使图标仍然只会显示所选大使相关的任务)" +L["GENERIC_ANIMA"] = "统一心能图标" +L["GENERIC_ANIMA_TT"] = "将不同的心能物品图标全部替换成同样的,类似之前的艾泽里特。仅影响地图标记和任务列表的图标。" +L["INCLUDE_DAILIES"] = "包含日常" +L["INCLUDE_DAILIES_TT"] = "将某些每日任务视作世界任务。仅影响暴雪自己视之为世界任务的每日任务。" +L["LIST_COLOR_TIME"] = "时长染色" +L["LIST_COLOR_TIME_TT"] = "根据剩余时长染色。临终一刻染红" +L["MAP_PINS"] = "任务点" +L["MINI_ICONS"] = "小图标" +L["NEW_PROFILE"] = "新配置文件" +L["NEW_PROFILE_TT"] = "基于现有设置新建一个配置文件" +L["PIN_BLIZZARD_TT"] = "暴雪风格的任务点" +L["PIN_CENTER"] = "主要图标类型" +L["PIN_CENTER_TT"] = "选择任务点中心的图标外观" +L["PIN_ELITE_RING"] = "精英镶边替换" +L["PIN_ELITE_RING_TT"] = "用尖刺环替代暴雪的精英龙环" +L["PIN_FADE_ON_PING"] = "突显焦点" +L["PIN_FADE_ON_PING_TT"] = "淡化所有非追踪的任务,从而突显追踪任务" +L["PIN_RARITY_ICON"] = "稀有任务标示" +L["PIN_RARITY_ICON_TT"] = "稀有任务点下方显示稀有标示" +L["PIN_REWARD_TT"] = "使用主要奖励的材质" +L["PIN_RING_HIDE_TT"] = "任务点不镶边" +L["PIN_RING_QUALITY_TT"] = "按任务稀有度镶边染色" +L["PIN_RING_TT"] = "选择任务点的外观" +L["PIN_SCALE"] = "任务点缩放" +L["PIN_SCALE_TT"] = "更改任务点的大小" +L["PIN_SHOW_CONTINENT"] = "母地图层可见" +L["PIN_SHOW_CONTINENT_TT"] = "任务点在其所属版本大洲地图上标记" +L["PIN_TIME_ICON"] = "剩余时长标示" +L["PIN_TIME_ICON_TT"] = "添加基于时长染色的剩余时长标示" +L["PIN_VISIBILITY_ALL_TT"] = "所有任务点都会显示" +L["PIN_VISIBILITY_CONTINENT"] = "全域可见" +L["PIN_VISIBILITY_CONTINENT_TT"] = "哪些任务点会在其所属版本的大洲地图上标记" +L["PIN_VISIBILITY_NONE_TT"] = "不显示任何任务点" +L["PIN_VISIBILITY_TRACKED"] = "仅追踪的" +L["PIN_VISIBILITY_TRACKED_TT"] = "只显示追踪的任务点" +L["PIN_VISIBILITY_ZONE"] = "局域可见" +L["PIN_VISIBILITY_ZONE_TT"] = "哪些任务点会在区域地图上标记" +L["PLACE_MAP_PIN"] = "建立地图标记" +L["PREVIOUS_EXPANSIONS"] = "旧资料片" +L["PROFILES"] = "配置文件" +L["PROFILE_NAME"] = "配置文件名" +L["PROFILE_NAME_TT"] = "更改配置文件名" +L["QUEST_LIST"] = "任务列表" +L["REMOVE_PROFILE"] = "删除配置文件" +L["REMOVE_PROFILE_TT"] = "删除当前启用的配置文件" +L["RESET_PROFILE"] = "重置配置文件" +L["RESET_PROFILE_TT"] = "重置当前启用的配置文件,恢复为预设配置" +L["REWARD_COLORS_AMOUNT"] = "奖励数量染色" +L["REWARD_COLORS_RING"] = "奖励镶边染色" +L["REWARD_CONDUITS"] = "导灵器" +L["REWARD_NUM_DISPLAY"] = "奖励种数" +L["REWARD_NUM_DISPLAY_PIN"] = "奖励图标" +L["REWARD_NUM_DISPLAY_PIN_TT"] = "根据任务的奖励类型添加图标,最多不超过奖励种数" +L["REWARD_NUM_DISPLAY_TT"] = "显示任务奖励的种数" +L["SHORTCUT_DISLIKE"] = "" +L["SHORTCUT_TRACK"] = "" +L["SHORTCUT_WAYPOINT"] = "" +L["TIME_COLORS"] = "时长染色" +L["TIME_CRITICAL"] = "15分钟" +L["TIME_CRITICAL_TT"] = "时长低于15分钟" +L["TIME_LONG"] = "1-3天" +L["TIME_LONG_TT"] = "时长介于1到3天之间" +L["TIME_MEDIUM"] = "1天" +L["TIME_MEDIUM_TT"] = "时长介于1到24小时之间" +L["TIME_SHORT"] = "1小时" +L["TIME_SHORT_TT"] = "时长介于15到60分钟之间" +L["TIME_VERYLONG"] = "3天以上" +L["TIME_VERYLONG_TT"] = "时长超过3天。通常用于世界首领" +L["TOMTOM_PIN"] = "TomTom导航点" +L["UNINTERESTED"] = "忽略" +L["UNINTERESTED_TT"] = "在列表中显示已“忽略”的任务" +L["WHATS_NEW"] = "最近更新" +--End of not trusted translation section L["IS_AZIAN_CLIENT"] = true end @@ -579,7 +665,7 @@ L["NEW_PROFILE_TT"] = "基於現有設置建立一個新設定檔。" L["NO_FACTION"] = "無陣營" L["NUMBERS_FIRST"] = "%g萬" L["NUMBERS_SECOND"] = "%g億" -L["NUMBERS_THIRD"] = "%g" +L["NUMBERS_THIRD"] = "%g兆" L["PIN_BIGGER"] = "地圖上顯示大型圖示" L["PIN_BIGGER_TT"] = "增加地圖示大小以提高可見性" L["PIN_BLIZZARD_TT"] = "模仿暴雪的任務點外觀。" @@ -688,6 +774,7 @@ L["USE_TOMTOM_TT"] = "在此插件添加TomTom功能。" L["WHATS_NEW"] = "最新消息" L["WHATS_NEW_TT"] = "查看World Quest Tab更新說明。" L["WQT_FULLSCREEN_BUTTON_TT"] = "左鍵點擊以切換世界任務列表。右鍵點擊並拖動以變更位置。" +L["IGNORES_FILTERS"] = "始終顯示類型" L["IS_AZIAN_CLIENT"] = true end diff --git a/MapPinProvider.lua b/MapPinProvider.lua index c66168f..3a24fbe 100644 --- a/MapPinProvider.lua +++ b/MapPinProvider.lua @@ -79,7 +79,7 @@ local function ShouldShowPin(questInfo, mapType, settingsZoneVisible, settingsPi return false; end elseif (mapType >= Enum.UIMapType.Zone) then - -- Never show on continent + -- Never show on zone if (settingsZoneVisible == _V["ENUM_PIN_ZONE"].none) then return false; end @@ -122,7 +122,12 @@ function WQT_PinDataProvider:Init() end, addonName); -- Fix pings and fades when switching map - hooksecurefunc(WorldMapFrame, "OnMapChanged", function() + -- hooksecurefunc(WorldMapFrame, "OnMapChanged", function() + -- wipe(self.pingedQuests); + -- self:UpdateQuestPings(); + -- end); + EventRegistry:RegisterCallback("MapCanvas.MapSet", function() + -- Now we do it modern way. wipe(self.pingedQuests); self:UpdateQuestPings(); end); @@ -206,7 +211,7 @@ function WQT_PinDataProvider:PlacePins() for k, questInfo in ipairs(WQT_WorldQuestFrame.dataProvider:GetIterativeList()) do local officialShow = true; if (wqp.focusedQuestID) then - officialShow = C_QuestLog.IsQuestCalling(wqp.focusedQuestID) and wqp:ShouldHighlightInfo(questInfo.questId); + officialShow = C_QuestLog.IsQuestCalling(wqp.focusedQuestID) and wqp:ShouldSupertrackHighlightInfo(questInfo.questId); end if (officialShow and ShouldShowPin(questInfo, mapInfo.mapType, settingsZoneVisible, settingsContinentVisible, settingsFilterPoI, isFlightMap)) then diff --git a/MapPinProvider.xml b/MapPinProvider.xml index c0ad5c0..bb9becc 100644 --- a/MapPinProvider.xml +++ b/MapPinProvider.xml @@ -1,4 +1,4 @@ - @@ -12,8 +12,8 @@ diff --git a/Profiles.lua b/Profiles.lua index 142cd5c..d856854 100644 --- a/Profiles.lua +++ b/Profiles.lua @@ -113,7 +113,7 @@ function WQT_Profiles:InitSettings() -- Version checking local settingVersion = WQT.db.global.versionCheck or"0"; - local currentVersion = GetAddOnMetadata(addonName, "version"); + local currentVersion = C_AddOns.GetAddOnMetadata(addonName, "version"); if (settingVersion < currentVersion) then WQT.db.global.updateSeen = false; WQT.db.global.versionCheck = currentVersion; diff --git a/Profiles.xml b/Profiles.xml index c8b1f33..3e3b5ec 100644 --- a/Profiles.xml +++ b/Profiles.xml @@ -1,4 +1,4 @@ - diff --git a/Settings.xml b/Settings.xml index 17aa41f..0a47b80 100644 --- a/Settings.xml +++ b/Settings.xml @@ -1,4 +1,4 @@ - @@ -200,7 +200,7 @@ - + diff --git a/Templates.lua b/Templates.lua index 6e57cc3..7d514ce 100644 --- a/Templates.lua +++ b/Templates.lua @@ -344,8 +344,8 @@ function WQT_Utils:GetFactionDataInternal(id) if (not factionData[id]) then -- Add new faction in case it's not in our data yet - factionData[id] = { ["expansion"] = 0 ,["faction"] = nil ,["texture"] = 1103069, ["unknown"] = true } - factionData[id].name = GetFactionInfoByID(id) or "Unknown Faction"; + factionData[id] = { ["expansion"] = 0 ,["faction"] = nil ,["texture"] = 134400, ["unknown"] = true } + factionData[id].name = GetFactionInfoByID(id) or UNKNOWN; WQT:debugPrint("Added new faction", id,factionData[id].name); end @@ -489,7 +489,7 @@ function WQT_Utils:GetPinTime(questInfo) maxTime = 5760*60; offset = -720*60; local tagInfo = questInfo:GetTagInfo(); - if (timeLeft > maxTime or (tagInfo.isElite and tagInfo.quality == Enum.WorldQuestQuality.Epic)) then + if (timeLeft > maxTime or tagInfo and (tagInfo.isElite and tagInfo.quality == Enum.WorldQuestQuality.Epic)) then maxTime = 1440 * 7*60; offset = 0; end @@ -623,8 +623,7 @@ local function _AddQuestRewardsToTooltip(tooltip, questID, style) end -- spells - local numQuestSpellRewards = GetNumQuestLogRewardSpells(questID); - if numQuestSpellRewards > 0 and not tooltip.ItemTooltip:IsShown() then + if C_QuestInfoSystem.HasQuestRewardSpells(questID) and not tooltip.ItemTooltip:IsShown() then if not EmbeddedItemTooltip_SetSpellByQuestReward(tooltip.ItemTooltip, 1, questID) then showRetrievingData = true; end @@ -652,7 +651,7 @@ function WQT_Utils:AddQuestRewardsToTooltip(tooltip, questID, style) if ( GetQuestLogRewardXP(questID) > 0 or GetNumQuestLogRewardCurrencies(questID) > 0 or GetNumQuestLogRewards(questID) > 0 or GetQuestLogRewardMoney(questID) > 0 or GetQuestLogRewardArtifactXP(questID) > 0 or GetQuestLogRewardHonor(questID) > 0 or - GetNumQuestLogRewardSpells(questID) > 0) then + C_QuestInfoSystem.HasQuestRewardSpells(questID)) then if tooltip.ItemTooltip then tooltip.ItemTooltip:Hide(); end @@ -1291,5 +1290,3 @@ function WQT_Utils:GetRewardTypeColorIDs(rewardType) return self:GetColor(ring), self:GetColor(text); end - - diff --git a/Templates.xml b/Templates.xml index d8aa9b1..6098796 100644 --- a/Templates.xml +++ b/Templates.xml @@ -1,4 +1,4 @@ - @@ -215,19 +215,21 @@ - + - - - - - - - - - - - + + + self:SetBackdrop({ + edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border", + tile = true, + tileEdge = true, + edgeSize = 12, + tileSize = 16, + insets = { left = 0, right = 0, top = 5, bottom = 5 }, + }); + self:ApplyBackdrop(); + + diff --git a/WorldQuestTab.lua b/WorldQuestTab.lua index e3ab172..f100f11 100644 --- a/WorldQuestTab.lua +++ b/WorldQuestTab.lua @@ -258,6 +258,12 @@ local function FilterDDFunc(ddFrame) -- Other expansions info = ddFrame:CreateButtonInfo("expand"); + + -- Shadowlands + info.text = EXPANSION_NAME8; + info.value = 303; + ddFrame:AddButton(info); + -- BFA info.text = EXPANSION_NAME7; info.value = 302; @@ -393,6 +399,26 @@ local function FilterDDFunc(ddFrame) for k, flagKey in pairs(order) do local factionInfo = type(flagKey) == "number" and WQT_Utils:GetFactionDataInternal(flagKey) or nil; + if (factionInfo and factionInfo.expansion == currExp and (not factionInfo.playerFaction or factionInfo.playerFaction == _playerFaction)) then + info.text = type(flagKey) == "number" and factionInfo.name or flagKey; + info.func = function(_, _, _, value) + options[flagKey] = value; + if (value) then + WQT_WorldQuestFrame.pinDataProvider:RefreshAllData() + end + WQT_QuestScrollFrame:UpdateQuestList(); + end + info.checked = function() return options[flagKey] end; + ddFrame:AddButton(info); + end + end + elseif value == 303 then -- Shadowlands + local options = WQT.settings.filters[1].flags; + local order = WQT.filterOrders[1] + local currExp = LE_EXPANSION_SHADOWLANDS; + for k, flagKey in pairs(order) do + local factionInfo = type(flagKey) == "number" and WQT_Utils:GetFactionDataInternal(flagKey) or nil; + if (factionInfo and factionInfo.expansion == currExp and (not factionInfo.playerFaction or factionInfo.playerFaction == _playerFaction)) then info.text = type(flagKey) == "number" and factionInfo.name or flagKey; info.func = function(_, _, _, value) @@ -1029,7 +1055,7 @@ function WQT:OnInitialize() WQT_Profiles:InitSettings(); -- Hightlight 'what's new' - local currentVersion = GetAddOnMetadata(addonName, "version") + local currentVersion = C_AddOns.GetAddOnMetadata(addonName, "version") if (WQT.db.global.versionCheck < currentVersion) then WQT.db.global.updateSeen = false; WQT.db.global.versionCheck = currentVersion; @@ -1668,7 +1694,7 @@ end function WQT_ScrollListMixin:DisplayQuestList() local mapId = WorldMapFrame.mapID; if (((FlightMapFrame and FlightMapFrame:IsShown()) or TaxiRouteMap:IsShown()) and not _WFMLoaded) then - local taxiId = GetTaxiMapID() + local taxiId = FlightMapFrame and FlightMapFrame:GetMapID() or GetTaxiMapID() mapId = (taxiId and taxiId > 0) and taxiId or mapId; end local mapInfo = WQT_Utils:GetCachedMapInfo(mapId or 0); @@ -2075,11 +2101,12 @@ function WQT_CoreMixin:OnLoad() end, addonName) self.dataProvider:RegisterCallback("BufferUpdated", function(progress) - if (progress == 0) then + if (progress == 0 or progress == 1) then self.ProgressBar:Hide(); + else + CooldownFrame_SetDisplayAsPercentage(self.ProgressBar, progress); + self.ProgressBar.Pointer:SetRotation(-progress*6.2831); end - CooldownFrame_SetDisplayAsPercentage(self.ProgressBar, progress); - self.ProgressBar.Pointer:SetRotation(-progress*6.2831); end, addonName) -- Events @@ -2128,11 +2155,17 @@ function WQT_CoreMixin:OnLoad() -- World map -- If we were reading details when we switch maps, change back to normal quests - hooksecurefunc(WorldMapFrame, "OnMapChanged", function() + -- hooksecurefunc(WorldMapFrame, "OnMapChanged", function() + -- if (self.selectedTab == WQT_TabDetails) then + -- self:SelectTab(WQT_TabNormal); + -- end + -- end) + EventRegistry:RegisterCallback("MapCanvas.MapSet", function() + -- Now we do it modern way. if (self.selectedTab == WQT_TabDetails) then self:SelectTab(WQT_TabNormal); end - end) + end); -- Update when opening the map WorldMapFrame:HookScript("OnShow", function() @@ -2284,21 +2317,22 @@ function WQT_CoreMixin:OnLoad() end); LFGListFrame.EntryCreation:HookScript("OnHide", function() - if (not InCombatLockdown()) then + if (not InCombatLockdown()) then WQT_GroupSearch:Hide(); end end); hooksecurefunc("LFGListUtil_FindQuestGroup", function(questID, isFromGreenEyeButton) - if (isFromGreenEyeButton) then + if (isFromGreenEyeButton) then WQT_GroupSearch:Hide(); WQT_GroupSearch.questId = nil; WQT_GroupSearch.title = nil; end end); - local LFGParent = LFGListSearchPanelScrollFrameScrollChild; - LFGParent.StartGroupButton:HookScript("OnClick", function() + local LFGParent = LFGListFrame.SearchPanel.ScrollBox; + if LFGParent and LFGParent.StartGroupButton then + LFGParent.StartGroupButton:HookScript("OnClick", function() -- If we are creating a group because we couldn't find one, show the info on the create frame if InCombatLockdown() then return; end local searchString = LFGListFrame.SearchPanel.SearchBox:GetText(); @@ -2317,7 +2351,7 @@ function WQT_CoreMixin:OnLoad() WQT_GroupSearch:Show(); end end) - + end -- Hook hiding of official pins if we replace them with our own local mapWQProvider = WQT_Utils:GetMapWQProvider(); hooksecurefunc(mapWQProvider, "RefreshAllData", function() @@ -2480,7 +2514,7 @@ function WQT_CoreMixin:SearchGroup(questInfo) WQT_GroupSearch:SetFrameLevel(LFGListFrame.SearchPanel.SearchBox:GetFrameLevel()+5); WQT_GroupSearch:ClearAllPoints(); WQT_GroupSearch:SetPoint("TOPLEFT", LFGListFrame.SearchPanel.SearchBox, "BOTTOMLEFT", -2, -3); - WQT_GroupSearch:SetPoint("RIGHT", LFGListFrame.SearchPanel, "RIGHT", -30, 0); + WQT_GroupSearch:SetPoint("RIGHT", LFGListFrame.SearchPanel.SearchBox, "RIGHT", -30, 0); WQT_GroupSearch.Text:SetText(_L["FORMAT_GROUP_SEARCH"]:format(id, title)); WQT_GroupSearch.downArrow = false; @@ -2609,7 +2643,7 @@ function WQT_CoreMixin:TAXIMAP_OPENED(system) end WQT_WorldQuestFrame:ChangeAnchorLocation(anchor); - self.dataProvider:LoadQuestsInZone(GetTaxiMapID()); + self.dataProvider:LoadQuestsInZone(FlightMapFrame and FlightMapFrame:GetMapID() or GetTaxiMapID()); end -- Reset official map filters diff --git a/WorldQuestTab.toc b/WorldQuestTab.toc index 07866dc..ef25dc3 100644 --- a/WorldQuestTab.toc +++ b/WorldQuestTab.toc @@ -1,10 +1,13 @@ -## Interface: 90100 +## Interface: 100205 ## Title: World Quest Tab ## Notes: Creates a new quest tab to keep track of world quests. ## Author: LanceDH -## Version: 9.1.01 +## Version: 10.2.5.0 ## SavedVariables: BWQDB +## X-Website: https://www.curseforge.com/wow/addons/worldquesttab +## X-Curse-Project-ID: 102243 +## IconTexture: Interface\Worldmap\UI-World-Icon WorldQuestTab.xml External\External.xml -Settings.xml \ No newline at end of file +Settings.xml diff --git a/WorldQuestTab.xml b/WorldQuestTab.xml index 26098b0..2972b39 100644 --- a/WorldQuestTab.xml +++ b/WorldQuestTab.xml @@ -1,4 +1,4 @@ - @@ -91,11 +91,12 @@ - - - - - + + + + + + @@ -1209,7 +1210,7 @@ self:SetParent(LFGListFrame.SearchPanel.SearchBox); self:SetFrameLevel(LFGListFrame.SearchPanel.SearchBox:GetFrameLevel()+5); self:SetPoint("TOPLEFT", LFGListFrame.SearchPanel.SearchBox, "BOTTOMLEFT", -2, -3); - self:SetPoint("RIGHT", LFGListFrame.SearchPanel, "RIGHT", -30, 0); + self:SetPoint("RIGHT", LFGListFrame.SearchPanel.SearchBox, "RIGHT", -30, 0); local height = self.Text:GetHeight(); diff --git a/libs/AceAddon-3.0/AceAddon-3.0.lua b/libs/AceAddon-3.0/AceAddon-3.0.lua index a7f7279..2bc30ba 100644 --- a/libs/AceAddon-3.0/AceAddon-3.0.lua +++ b/libs/AceAddon-3.0/AceAddon-3.0.lua @@ -1,4 +1,4 @@ ---- **AceAddon-3.0** provides a template for creating addon objects. +--- **AceAddon-3.0** provides a template for creating addon objects. -- It'll provide you with a set of callback functions that allow you to simplify the loading -- process of your addon.\\ -- Callbacks provided are:\\ @@ -6,31 +6,31 @@ -- * **OnEnable** which gets called during the PLAYER_LOGIN event, when most of the data provided by the game is already present. -- * **OnDisable**, which is only called when your addon is manually being disabled. -- @usage --- -- A small (but complete) addon, that doesn't do anything, +-- -- A small (but complete) addon, that doesn't do anything, -- -- but shows usage of the callbacks. -- local MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") --- +-- -- function MyAddon:OnInitialize() --- -- do init tasks here, like loading the Saved Variables, +-- -- do init tasks here, like loading the Saved Variables, -- -- or setting up slash commands. -- end --- +-- -- function MyAddon:OnEnable() -- -- Do more initialization here, that really enables the use of your addon. --- -- Register Events, Hook functions, Create Frames, Get information from +-- -- Register Events, Hook functions, Create Frames, Get information from -- -- the game that wasn't available in OnInitialize -- end -- -- function MyAddon:OnDisable() -- -- Unhook, Unregister Events, Hide frames that you created. --- -- You would probably only use an OnDisable if you want to +-- -- You would probably only use an OnDisable if you want to -- -- build a "standby" mode, or be able to toggle modules on/off. -- end -- @class file -- @name AceAddon-3.0.lua --- @release $Id: AceAddon-3.0.lua 1084 2013-04-27 20:14:11Z nevcairiel $ +-- @release $Id: AceAddon-3.0.lua 1284 2022-09-25 09:15:30Z nevcairiel $ -local MAJOR, MINOR = "AceAddon-3.0", 12 +local MAJOR, MINOR = "AceAddon-3.0", 13 local AceAddon, oldminor = LibStub:NewLibrary(MAJOR, MINOR) if not AceAddon then return end -- No Upgrade needed. @@ -49,10 +49,6 @@ local select, pairs, next, type, unpack = select, pairs, next, type, unpack local loadstring, assert, error = loadstring, assert, error local setmetatable, getmetatable, rawset, rawget = setmetatable, getmetatable, rawset, rawget --- Global vars/functions that we don't upvalue since they might get hooked, or upgraded --- List them here for Mikk's FindGlobals script --- GLOBALS: LibStub, IsLoggedIn, geterrorhandler - --[[ xpcall safecall implementation ]] @@ -62,43 +58,12 @@ local function errorhandler(err) return geterrorhandler()(err) end -local function CreateDispatcher(argCount) - local code = [[ - local xpcall, eh = ... - local method, ARGS - local function call() return method(ARGS) end - - local function dispatch(func, ...) - method = func - if not method then return end - ARGS = ... - return xpcall(call, eh) - end - - return dispatch - ]] - - local ARGS = {} - for i = 1, argCount do ARGS[i] = "arg"..i end - code = code:gsub("ARGS", tconcat(ARGS, ", ")) - return assert(loadstring(code, "safecall Dispatcher["..argCount.."]"))(xpcall, errorhandler) -end - -local Dispatchers = setmetatable({}, {__index=function(self, argCount) - local dispatcher = CreateDispatcher(argCount) - rawset(self, argCount, dispatcher) - return dispatcher -end}) -Dispatchers[0] = function(func) - return xpcall(func, errorhandler) -end - local function safecall(func, ...) -- we check to see if the func is passed is actually a function here and don't error when it isn't -- this safecall is used for optional functions like OnInitialize OnEnable etc. When they are not -- present execution should continue without hinderance if type(func) == "function" then - return Dispatchers[select('#', ...)](func, ...) + return xpcall(func, errorhandler, ...) end end @@ -106,7 +71,7 @@ end local Enable, Disable, EnableModule, DisableModule, Embed, NewModule, GetModule, GetName, SetDefaultModuleState, SetDefaultModuleLibraries, SetEnabledState, SetDefaultModulePrototype -- used in the addon metatable -local function addontostring( self ) return self.name end +local function addontostring( self ) return self.name end -- Check if the addon is queued for initialization local function queuedForInitialization(addon) @@ -119,14 +84,14 @@ local function queuedForInitialization(addon) end --- Create a new AceAddon-3.0 addon. --- Any libraries you specified will be embeded, and the addon will be scheduled for +-- Any libraries you specified will be embeded, and the addon will be scheduled for -- its OnInitialize and OnEnable callbacks. -- The final addon object, with all libraries embeded, will be returned. -- @paramsig [object ,]name[, lib, ...] -- @param object Table to use as a base for the addon (optional) -- @param name Name of the addon object to create -- @param lib List of libraries to embed into the addon --- @usage +-- @usage -- -- Create a simple addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon", "AceEvent-3.0") -- @@ -146,10 +111,10 @@ function AceAddon:NewAddon(objectorname, ...) if type(name)~="string" then error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end - if self.addons[name] then + if self.addons[name] then error(("Usage: NewAddon([object,] name, [lib, lib, lib, ...]): 'name' - Addon '%s' already exists."):format(name), 2) end - + object = object or {} object.name = name @@ -159,7 +124,7 @@ function AceAddon:NewAddon(objectorname, ...) for k, v in pairs(oldmeta) do addonmeta[k] = v end end addonmeta.__tostring = addontostring - + setmetatable( object, addonmeta ) self.addons[name] = object object.modules = {} @@ -167,7 +132,7 @@ function AceAddon:NewAddon(objectorname, ...) object.defaultModuleLibraries = {} Embed( object ) -- embed NewModule, GetModule methods self:EmbedLibraries(object, select(i,...)) - + -- add to queue of addons to be initialized upon ADDON_LOADED tinsert(self.initializequeue, object) return object @@ -178,7 +143,7 @@ end -- Throws an error if the addon object cannot be found (except if silent is set). -- @param name unique name of the addon object -- @param silent if true, the addon is optional, silently return nil if its not found --- @usage +-- @usage -- -- Get the Addon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") function AceAddon:GetAddon(name, silent) @@ -233,7 +198,7 @@ end -- @paramsig name[, silent] -- @param name unique name of the module -- @param silent if true, the module is optional, silently return nil if its not found (optional) --- @usage +-- @usage -- -- Get the Addon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- -- Get the Module @@ -256,23 +221,23 @@ local function IsModuleTrue(self) return true end -- @param name unique name of the module -- @param prototype object to derive this module from, methods and values from this table will be mixed into the module (optional) -- @param lib List of libraries to embed into the addon --- @usage +-- @usage -- -- Create a module with some embeded libraries -- MyModule = MyAddon:NewModule("MyModule", "AceEvent-3.0", "AceHook-3.0") --- +-- -- -- Create a module with a prototype -- local prototype = { OnEnable = function(self) print("OnEnable called!") end } -- MyModule = MyAddon:NewModule("MyModule", prototype, "AceEvent-3.0", "AceHook-3.0") function NewModule(self, name, prototype, ...) if type(name) ~= "string" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - string expected got '%s'."):format(type(name)), 2) end if type(prototype) ~= "string" and type(prototype) ~= "table" and type(prototype) ~= "nil" then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'prototype' - table (prototype), string (lib) or nil expected got '%s'."):format(type(prototype)), 2) end - + if self.modules[name] then error(("Usage: NewModule(name, [prototype, [lib, lib, lib, ...]): 'name' - Module '%s' already exists."):format(name), 2) end - + -- modules are basically addons. We treat them as such. They will be added to the initializequeue properly as well. -- NewModule can only be called after the parent addon is present thus the modules will be initialized after their parent is. local module = AceAddon:NewAddon(fmt("%s_%s", self.name or tostring(self), name)) - + module.IsModule = IsModuleTrue module:SetEnabledState(self.defaultModuleState) module.moduleName = name @@ -287,24 +252,24 @@ function NewModule(self, name, prototype, ...) if not prototype or type(prototype) == "string" then prototype = self.defaultModulePrototype or nil end - + if type(prototype) == "table" then local mt = getmetatable(module) mt.__index = prototype setmetatable(module, mt) -- More of a Base class type feel. end - + safecall(self.OnModuleCreated, self, module) -- Was in Ace2 and I think it could be a cool thing to have handy. self.modules[name] = module tinsert(self.orderedModules, module) - + return module end --- Returns the real name of the addon or module, without any prefix. -- @name //addon//:GetName --- @paramsig --- @usage +-- @paramsig +-- @usage -- print(MyAddon:GetName()) -- -- prints "MyAddon" function GetName(self) @@ -316,8 +281,8 @@ end -- and enabling all modules of the addon (unless explicitly disabled).\\ -- :Enable() also sets the internal `enableState` variable to true -- @name //addon//:Enable --- @paramsig --- @usage +-- @paramsig +-- @usage -- -- Enable MyModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") @@ -337,8 +302,8 @@ end -- and disabling all modules of the addon.\\ -- :Disable() also sets the internal `enableState` variable to false -- @name //addon//:Disable --- @paramsig --- @usage +-- @paramsig +-- @usage -- -- Disable MyAddon -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyAddon:Disable() @@ -351,7 +316,7 @@ end -- Short-hand function that retrieves the module via `:GetModule` and calls `:Enable` on the module object. -- @name //addon//:EnableModule -- @paramsig name --- @usage +-- @usage -- -- Enable MyModule using :GetModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") @@ -369,7 +334,7 @@ end -- Short-hand function that retrieves the module via `:GetModule` and calls `:Disable` on the module object. -- @name //addon//:DisableModule -- @paramsig name --- @usage +-- @usage -- -- Disable MyModule using :GetModule -- MyAddon = LibStub("AceAddon-3.0"):GetAddon("MyAddon") -- MyModule = MyAddon:GetModule("MyModule") @@ -388,7 +353,7 @@ end -- @name //addon//:SetDefaultModuleLibraries -- @paramsig lib[, lib, ...] -- @param lib List of libraries to embed into the addon --- @usage +-- @usage -- -- Create the addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") -- -- Configure default libraries for modules (all modules need AceEvent-3.0) @@ -407,7 +372,7 @@ end -- @name //addon//:SetDefaultModuleState -- @paramsig state -- @param state Default state for new modules, true for enabled, false for disabled --- @usage +-- @usage -- -- Create the addon object -- MyAddon = LibStub("AceAddon-3.0"):NewAddon("MyAddon") -- -- Set the default state to "disabled" @@ -427,7 +392,7 @@ end -- @name //addon//:SetDefaultModulePrototype -- @paramsig prototype -- @param prototype Default prototype for the new modules (table) --- @usage +-- @usage -- -- Define a prototype -- local prototype = { OnEnable = function(self) print("OnEnable called!") end } -- -- Set the default prototype @@ -459,8 +424,8 @@ end --- Return an iterator of all modules associated to the addon. -- @name //addon//:IterateModules --- @paramsig --- @usage +-- @paramsig +-- @usage -- -- Enable all modules -- for name, module in MyAddon:IterateModules() do -- module:Enable() @@ -469,13 +434,13 @@ local function IterateModules(self) return pairs(self.modules) end -- Returns an iterator of all embeds in the addon -- @name //addon//:IterateEmbeds --- @paramsig +-- @paramsig local function IterateEmbeds(self) return pairs(AceAddon.embeds[self]) end --- Query the enabledState of an addon. -- @name //addon//:IsEnabled --- @paramsig --- @usage +-- @paramsig +-- @usage -- if MyAddon:IsEnabled() then -- MyAddon:Disable() -- end @@ -520,20 +485,20 @@ end -- - Initialize the addon after creation. -- This function is only used internally during the ADDON_LOADED event --- It will call the **OnInitialize** function on the addon object (if present), +-- It will call the **OnInitialize** function on the addon object (if present), -- and the **OnEmbedInitialize** function on all embeded libraries. --- +-- -- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. -- @param addon addon object to intialize function AceAddon:InitializeAddon(addon) safecall(addon.OnInitialize, addon) - + local embeds = self.embeds[addon] for i = 1, #embeds do local lib = LibStub:GetLibrary(embeds[i], true) if lib then safecall(lib.OnEmbedInitialize, lib, addon) end end - + -- we don't call InitializeAddon on modules specifically, this is handled -- from the event handler and only done _once_ end @@ -541,7 +506,7 @@ end -- - Enable the addon after creation. -- Note: This function is only used internally during the PLAYER_LOGIN event, or during ADDON_LOADED, -- if IsLoggedIn() already returns true at that point, e.g. for LoD Addons. --- It will call the **OnEnable** function on the addon object (if present), +-- It will call the **OnEnable** function on the addon object (if present), -- and the **OnEmbedEnable** function on all embeded libraries.\\ -- This function does not toggle the enable state of the addon itself, and will return early if the addon is disabled. -- @@ -551,12 +516,12 @@ end function AceAddon:EnableAddon(addon) if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end if self.statuses[addon.name] or not addon.enabledState then return false end - + -- set the statuses first, before calling the OnEnable. this allows for Disabling of the addon in OnEnable. self.statuses[addon.name] = true - + safecall(addon.OnEnable, addon) - + -- make sure we're still enabled before continueing if self.statuses[addon.name] then local embeds = self.embeds[addon] @@ -564,7 +529,7 @@ function AceAddon:EnableAddon(addon) local lib = LibStub:GetLibrary(embeds[i], true) if lib then safecall(lib.OnEmbedEnable, lib, addon) end end - + -- enable possible modules. local modules = addon.orderedModules for i = 1, #modules do @@ -576,24 +541,24 @@ end -- - Disable the addon -- Note: This function is only used internally. --- It will call the **OnDisable** function on the addon object (if present), +-- It will call the **OnDisable** function on the addon object (if present), -- and the **OnEmbedDisable** function on all embeded libraries.\\ -- This function does not toggle the enable state of the addon itself, and will return early if the addon is still enabled. -- --- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. +-- **Note:** Do not call this function manually, unless you're absolutely sure that you know what you are doing. -- Use :Disable on the addon itself instead. -- @param addon addon object to enable function AceAddon:DisableAddon(addon) if type(addon) == "string" then addon = AceAddon:GetAddon(addon) end if not self.statuses[addon.name] then return false end - + -- set statuses first before calling OnDisable, this allows for aborting the disable in OnDisable. self.statuses[addon.name] = false - + safecall( addon.OnDisable, addon ) - + -- make sure we're still disabling... - if not self.statuses[addon.name] then + if not self.statuses[addon.name] then local embeds = self.embeds[addon] for i = 1, #embeds do local lib = LibStub:GetLibrary(embeds[i], true) @@ -605,12 +570,12 @@ function AceAddon:DisableAddon(addon) self:DisableAddon(modules[i]) end end - + return not self.statuses[addon.name] -- return true if we're disabled end --- Get an iterator over all registered addons. --- @usage +-- @usage -- -- Print a list of all installed AceAddon's -- for name, addon in AceAddon:IterateAddons() do -- print("Addon: " .. name) @@ -618,7 +583,7 @@ end function AceAddon:IterateAddons() return pairs(self.addons) end --- Get an iterator over the internal status registry. --- @usage +-- @usage -- -- Print a list of all enabled addons -- for name, status in AceAddon:IterateAddonStatus() do -- if status then @@ -632,10 +597,20 @@ function AceAddon:IterateAddonStatus() return pairs(self.statuses) end function AceAddon:IterateEmbedsOnAddon(addon) return pairs(self.embeds[addon]) end function AceAddon:IterateModulesOfAddon(addon) return pairs(addon.modules) end +-- Blizzard AddOns which can load very early in the loading process and mess with Ace3 addon loading +local BlizzardEarlyLoadAddons = { + Blizzard_DebugTools = true, + Blizzard_TimeManager = true, + Blizzard_BattlefieldMap = true, + Blizzard_MapCanvas = true, + Blizzard_SharedMapDataProviders = true, + Blizzard_CombatLog = true, +} + -- Event Handling local function onEvent(this, event, arg1) - -- 2011-08-17 nevcairiel - ignore the load event of Blizzard_DebugTools, so a potential startup error isn't swallowed up - if (event == "ADDON_LOADED" and arg1 ~= "Blizzard_DebugTools") or event == "PLAYER_LOGIN" then + -- 2020-08-28 nevcairiel - ignore the load event of Blizzard addons which occur early in the loading process + if (event == "ADDON_LOADED" and (arg1 == nil or not BlizzardEarlyLoadAddons[arg1])) or event == "PLAYER_LOGIN" then -- if a addon loads another addon, recursion could happen here, so we need to validate the table on every iteration while(#AceAddon.initializequeue > 0) do local addon = tremove(AceAddon.initializequeue, 1) @@ -644,7 +619,7 @@ local function onEvent(this, event, arg1) AceAddon:InitializeAddon(addon) tinsert(AceAddon.enablequeue, addon) end - + if IsLoggedIn() then while(#AceAddon.enablequeue > 0) do local addon = tremove(AceAddon.enablequeue, 1) diff --git a/libs/AceAddon-3.0/AceAddon-3.0.xml b/libs/AceAddon-3.0/AceAddon-3.0.xml index e6ad639..ae12b73 100644 --- a/libs/AceAddon-3.0/AceAddon-3.0.xml +++ b/libs/AceAddon-3.0/AceAddon-3.0.xml @@ -1,4 +1,4 @@ -