Skip to content

Commit 7ece293

Browse files
committed
* Added support for Siren Isle (TWW)
* Added icon for world quests that involve Legion world bosses (quest TagID 144)
1 parent 73e134b commit 7ece293

5 files changed

+53
-14
lines changed

Broker_WorldQuests.toc

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
## Interface: 110005
1+
## Interface: 110007
22
## Author: myno (original author; up through 8.x), Amadeus (maintainer since 9.0)
33
## Title: Broker_WorldQuests
4-
## Version: 11.0.5.2
4+
## Version: 11.0.7.0
55
## SavedVariables: BWQcfg
66
## SavedVariablesPerCharacter: BWQcache, BWQcfgPerCharacter
77
## OptionalDeps: TomTom

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### 11.0.7.0
2+
* Added support for Siren Isle (TWW)
3+
* Added icon for world quests that involve Legion world bosses (quest TagID 144)
4+
15
### 11.0.5.2
26
* Added support for Bronze Celebration Token currency
37

Globals.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ BWQ.MAP_ZONES = {
4141
[2215] = { id = 2215, name = C_Map.GetMapInfo(2215).name, quests = {}, buttons = {}, }, -- Hallowfall 11.0
4242
[2255] = { id = 2255, name = C_Map.GetMapInfo(2255).name, quests = {}, buttons = {}, }, -- Azj-Kahet 11.0
4343
[2213] = { id = 2213, name = C_Map.GetMapInfo(2213).name, quests = {}, buttons = {}, }, -- City of Threads 11.0
44+
[2369] = { id = 2369, name = C_Map.GetMapInfo(2369).name, quests = {}, buttons = {}, }, -- Siren Isle 11.0.7
4445
},
4546
[CONSTANTS.EXPANSIONS.DRAGONFLIGHT] = {
4647
[2022] = { id = 2022, name = C_Map.GetMapInfo(2022).name, quests = {}, buttons = {}, }, -- The Waking Shores 10.0
@@ -92,7 +93,7 @@ BWQ.MAP_ZONES = {
9293
-- The following table is used to sort the zones when displayed. This table should only include zones that are in the
9394
-- BWQ.MAP_ZONES table above.
9495
BWQ.MAP_ZONES_SORT = {
95-
[CONSTANTS.EXPANSIONS.THEWARWITHIN] = { 2248, 2214, 2215, 2255, 2213 },
96+
[CONSTANTS.EXPANSIONS.THEWARWITHIN] = { 2248, 2214, 2215, 2255, 2213, 2369 },
9697
[CONSTANTS.EXPANSIONS.DRAGONFLIGHT] = { 2022, 2023, 2024, 2025, 2085, 2151, 2133, 2200 },
9798
[CONSTANTS.EXPANSIONS.SHADOWLANDS] = { 1525, 1533, 1536, 1565, 1543, 1970 },
9899
[CONSTANTS.EXPANSIONS.BFA] = { 1530, 1527, 1355, 1462, 62, 14, 863, 864, 862, 895, 942, 896, 1161 },

Utilities.lua

+2-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ end
1717

1818
function BWQ:FormatTimeLeftString(minutes)
1919
local timeLeftStr = ""
20-
if minutes <= 0 then return "" end
20+
21+
if not minutes or minutes <= 0 then return "" end
2122

2223
local days = math.floor(minutes / 1440)
2324
local hours = math.floor((minutes % 1440) / 60)

WorldQuests.lua

+43-10
Original file line numberDiff line numberDiff line change
@@ -901,8 +901,15 @@ local RetrieveWorldQuests = function(mapId)
901901
quest.timeLeftString = timeLeftStr
902902
elseif string.find(widgetInfo.text, "Complete") then
903903
local quests, zone = string.match(widgetInfo.text, "Complete (%d+) |4world quest:world quests; in ?(.-) to unlock")
904-
if string.find(zone,"the") then
905-
zone = string.match(zone, "^the%s*(.+)") -- remove the word "the" if it's the first word in the string and lowercase.
904+
if zone then
905+
-- TODO: Why am I parsing the zone name rather than just using C_Map.GetMapInfo(mapId).name or "UNKNOWN" ??
906+
if string.find(zone,"the") then
907+
zone = string.match(zone, "^the%s*(.+)") -- remove the word "the" if it's the first word in the string and lowercase.
908+
end
909+
else
910+
quest.LockedWQ_QuestToComplete = string.match(widgetInfo.text, "Complete ?(.-) to unlock")
911+
--print(string.format("[BWQ]: %s", quest.LockedWQ_QuestToComplete))
912+
zone = C_Map.GetMapInfo(mapId).name or "UNKNOWN"
906913
end
907914
quest.LockedWQ_questsRemaining = quests and tonumber(quests) or 0
908915
quest.LockedWQ_zone = zone or ""
@@ -931,9 +938,27 @@ local RetrieveWorldQuests = function(mapId)
931938
end
932939

933940
if BWQ:C("sortByTimeRemaining") then
934-
table.sort(BWQ.MAP_ZONES[BWQ.expansion][mapId].questsSort, function(a, b) return BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[a].timeLeft < BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[b].timeLeft end)
941+
table.sort(BWQ.MAP_ZONES[BWQ.expansion][mapId].questsSort, function(a, b)
942+
local questA = BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[a]
943+
local questB = BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[b]
944+
945+
-- If either quest is nil, put it at the end
946+
if not questA or not questA.timeLeft then return false end
947+
if not questB or not questB.timeLeft then return true end
948+
949+
return questA.timeLeft < questB.timeLeft
950+
end)
935951
else -- reward type
936-
table.sort(BWQ.MAP_ZONES[BWQ.expansion][mapId].questsSort, function(a, b) return BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[a].sort > BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[b].sort end)
952+
table.sort(BWQ.MAP_ZONES[BWQ.expansion][mapId].questsSort, function(a, b)
953+
local questA = BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[a]
954+
local questB = BWQ.MAP_ZONES[BWQ.expansion][mapId].quests[b]
955+
956+
-- If either quest is nil, put it at the end
957+
if not questA or not questA.sort then return false end
958+
if not questB or not questB.sort then return true end
959+
960+
return questA.sort > questB.sort
961+
end)
937962
end
938963

939964
BWQ.MAP_ZONES[BWQ.expansion][mapId].numQuests = numQuests
@@ -1264,12 +1289,20 @@ function BWQ:UpdateBlock()
12641289
local rewardText = ""
12651290
if button.quest.LockedWQ then
12661291
-- To find Atlas textures such as the "padlock" below. Use the /tav command (Texture Atlas Viewer addon).
1267-
rewardText = string.format(
1268-
"|cnWARNING_FONT_COLOR:|A:%s:14:14|a Complete %d more %s in %s|r",
1269-
"Garr_LockedBuilding",
1270-
button.quest.LockedWQ_questsRemaining and button.quest.LockedWQ_questsRemaining or "",
1271-
button.quest.LockedWQ_questsRemaining > 1 and "WQs" or "WQ",
1272-
button.quest.LockedWQ_zone and button.quest.LockedWQ_zone or "")
1292+
if button.quest.LockedWQ_QuestToComplete then
1293+
rewardText = string.format(
1294+
"|cnWARNING_FONT_COLOR:|A:%s:14:14|a Complete the quest '%s' in %s|r",
1295+
"Garr_LockedBuilding",
1296+
button.quest.LockedWQ_QuestToComplete,
1297+
button.quest.LockedWQ_zone and button.quest.LockedWQ_zone or "")
1298+
else
1299+
rewardText = string.format(
1300+
"|cnWARNING_FONT_COLOR:|A:%s:14:14|a Complete %d more %s in %s|r",
1301+
"Garr_LockedBuilding",
1302+
button.quest.LockedWQ_questsRemaining and button.quest.LockedWQ_questsRemaining or "",
1303+
button.quest.LockedWQ_questsRemaining > 1 and "WQs" or "WQ",
1304+
button.quest.LockedWQ_zone and button.quest.LockedWQ_zone or "")
1305+
end
12731306
button.reward:SetScript("OnEvent", function(self, event)
12741307
if event == "MODIFIER_STATE_CHANGED" then
12751308
if button.reward:IsMouseOver() and button.reward:IsShown() then

0 commit comments

Comments
 (0)