Skip to content

Commit

Permalink
Fixed an issue with corrupted quest data
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Aug 31, 2024
1 parent a2c5167 commit 31aaafa
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 18 deletions.
3 changes: 3 additions & 0 deletions WorldQuestTracker_IDs.lua
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ WorldQuestTracker.MapData.ZoneIDs = {
DORN = 2248,
AZJKAHET = 2255,
HALLOWFALL = 2215,
CITYTHREADS = 2213,

--Dragonflight
DRAGONISLES = 1978,
Expand Down Expand Up @@ -124,6 +125,7 @@ WorldQuestTracker.DotLineScale = {
[zoneIDs.DORN] = 3,
[zoneIDs.AZJKAHET] = 3,
[zoneIDs.HALLOWFALL] = 3,
[zoneIDs.CITYTHREADS] = 3,
}

--all zones with world quests
Expand All @@ -133,6 +135,7 @@ WorldQuestTracker.MapData.WorldQuestZones = {
[zoneIDs.AZJKAHET] = true,
[zoneIDs.HALLOWFALL] = true,
[zoneIDs.AZJKAHET] = true,
[zoneIDs.CITYTHREADS] = true,

--Dragonflight
[zoneIDs.AZURESSPAN] = true,
Expand Down
4 changes: 4 additions & 0 deletions WorldQuestTracker_WorldMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1151,6 +1151,10 @@ function WorldQuestTracker.UpdateWorldWidget(widget, questID, numObjectives, map
if (okay) then
local conduitType, borderTexture, borderColor, itemLink = WorldQuestTracker.GetConduitQuestData(questID)
WorldQuestTracker.UpdateBorder(widget, rarity, worldQuestType, nil, nil, nil, conduitType, borderTexture, borderColor, itemLink)
else
widget.texture:SetTexture([[Interface\Icons\INV_Misc_QuestionMark]])
widget.amountText:SetText("")
widget.IconText = ""
end

return okay, amountGold, amountResources, amountAPower
Expand Down
44 changes: 26 additions & 18 deletions WorldQuestTracker_ZoneMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
WorldQuestTrackerDataProvider:GetMap():RemoveAllPinsByTemplate("WorldQuestTrackerPOIPinTemplate")
WorldQuestTracker.HideAllPOIPins()

--~locked
--~locked ~poi ~areapoi
for pin in map:EnumeratePinsByTemplate("AreaPOIPinTemplate") do
local atlasName = pin.Texture:GetAtlas()
pin.Texture:SetAlpha(0.934)
Expand Down Expand Up @@ -918,17 +918,17 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
end

if (timeLeft > 0) then --not isSuppressed and passFilters and timeLeft
local can_cache = true
local bCanCache = true
if (not HaveQuestRewardData(questID)) then
C_TaskQuest.RequestPreloadRewardData(questID)
can_cache = false
bCanCache = false
needAnotherUpdate = true
end
WorldQuestTracker.CurrentZoneQuests [questID] = true

local title, factionID, tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex, tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex, allowDisplayPastCritical, gold, goldFormated, rewardName, rewardTexture, numRewardItems, itemName, itemTexture, itemLevel, itemQuantity, itemQuality, isUsable, itemID, isArtifact, artifactPower, isStackable, stackAmount = WorldQuestTracker.GetOrLoadQuestData(questID, can_cache)
local title, factionID, tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex, tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex, allowDisplayPastCritical, gold, goldFormated, rewardName, rewardTexture, numRewardItems, itemName, itemTexture, itemLevel, itemQuantity, itemQuality, isUsable, itemID, isArtifact, artifactPower, isStackable, stackAmount = WorldQuestTracker.GetOrLoadQuestData(questID, bCanCache)
local filter, order = WorldQuestTracker.GetQuestFilterTypeAndOrder(worldQuestType, gold, rewardName, itemName, isArtifact, stackAmount, numRewardItems, rewardTexture, tagID)
local passFilter = filters [filter]
local passFilter = filters[filter]

if (not passFilter) then
if (rarity == LE_WORLD_QUEST_QUALITY_EPIC) then
Expand Down Expand Up @@ -1013,8 +1013,8 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)

widget:Show()

tinsert(WorldQuestTracker.Cache_ShownQuestOnZoneMap, questID)
tinsert(WorldQuestTracker.Cache_ShownWidgetsOnZoneMap, widget)
table.insert(WorldQuestTracker.Cache_ShownQuestOnZoneMap, questID)
table.insert(WorldQuestTracker.Cache_ShownWidgetsOnZoneMap, widget)

widget:SetScale(scale) --affect only zones(not the world map)

Expand Down Expand Up @@ -1067,8 +1067,8 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
end

--> add the widget to cache tables
tinsert(WorldQuestTracker.Cache_ShownQuestOnZoneMap, questID)
tinsert(WorldQuestTracker.Cache_ShownWidgetsOnZoneMap, widget)
table.insert(WorldQuestTracker.Cache_ShownQuestOnZoneMap, questID)
table.insert(WorldQuestTracker.Cache_ShownWidgetsOnZoneMap, widget)
end
end

Expand All @@ -1089,7 +1089,7 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)

end --is world quest

else --have quest data
else --don't have quest data
if (WorldQuestTracker.__debug) then
local questName = C_QuestLog.GetTitleForQuestID(questID)
WorldQuestTracker:Msg("no HaveQuestData for quest", questID, questName)
Expand Down Expand Up @@ -1135,7 +1135,7 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
end

for i = index, #ZoneWidgetPool do
ZoneWidgetPool [i]:Hide()
ZoneWidgetPool[i]:Hide()
end

if (WorldQuestTracker.WorldMap_GoldIndicator) then
Expand Down Expand Up @@ -1183,7 +1183,6 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
end

WorldQuestTracker.UpdateZoneSummaryFrame()

end

--check if the zone has extra data to show like quests, pois, etc
Expand Down Expand Up @@ -1280,7 +1279,7 @@ function WorldQuestTracker.ResetWorldQuestZoneButton(self)
self.Amount = nil
end

--this function does not check if the quest reward is in the client cache
--this function does not check if the quest reward is in the client cache ~update ~setup ~button
function WorldQuestTracker.SetupWorldQuestButton(self, worldQuestType, rarity, isElite, tradeskillLineIndex, inProgress, selected, isCriteria, isSpellTarget, mapID)
if (type(worldQuestType) == "boolean" and worldQuestType) then
--quick refresh
Expand Down Expand Up @@ -1558,6 +1557,11 @@ function WorldQuestTracker.SetupWorldQuestButton(self, worldQuestType, rarity, i
end

if (not okay) then
self.Texture:SetTexture([[Interface\Icons\INV_Misc_QuestionMark]])
self.circleBorder:Show()
self.circleBorder:SetTexture("Interface\\AddOns\\WorldQuestTracker\\media\\border_zone_whiteT")
self.Texture:SetSize(16, 16)

if (UpdateDebug) then print("NeedUpdate 4") end
WorldQuestTracker.ScheduleZoneMapUpdate()
end
Expand Down Expand Up @@ -1826,7 +1830,11 @@ function WorldQuestTracker.SetupZoneSummaryButton(summaryWidget, zoneWidget)
widget.trackingGlowBorder:Hide()

--set the amount text
summaryWidget.Text:SetText(type(zoneWidget.IconText) == "number" and floor(zoneWidget.IconText) or zoneWidget.IconText)
if (okay) then
summaryWidget.Text:SetText(type(zoneWidget.IconText) == "number" and floor(zoneWidget.IconText) or zoneWidget.IconText)
else
summaryWidget.Text:SetText("")
end

if (widget.criteriaIndicator:IsShown()) then
summaryWidget.timeLeftText:SetPoint("left", widget, "right", 66, 0)
Expand Down Expand Up @@ -1987,24 +1995,24 @@ function WorldQuestTracker.UpdateZoneSummaryFrame()
return t1.Order > t2.Order
end)

local LastWidget
local lastWidget
local isSummaryMinimized = WorldQuestTracker.db.profile.quest_summary_minimized

if (not isSummaryMinimized) then
for i = 1, #WorldQuestTracker.Cache_ShownWidgetsOnZoneMap do
local zoneWidget = WorldQuestTracker.Cache_ShownWidgetsOnZoneMap [i]
local zoneWidget = WorldQuestTracker.Cache_ShownWidgetsOnZoneMap[i]
local summaryWidget = WorldQuestTracker.GetOrCreateZoneSummaryWidget(index)

summaryWidget._Twin = zoneWidget
WorldQuestTracker.SetupZoneSummaryButton(summaryWidget, zoneWidget)
LastWidget = summaryWidget
lastWidget = summaryWidget

index = index + 1
end
end

--attach the header to the last widget
if (LastWidget) then
if (lastWidget) then
ZoneSumaryFrame.Header:Show()
--ZoneSumaryFrame.Header:SetPoint("bottomleft", LastWidget, "topleft", 20, 0)
end
Expand Down

0 comments on commit 31aaafa

Please sign in to comment.