Skip to content

Commit

Permalink
10.0.5 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Oct 22, 2024
1 parent bb8396b commit 9cbcf71
Show file tree
Hide file tree
Showing 14 changed files with 288 additions and 92 deletions.
5 changes: 3 additions & 2 deletions WorldQuestTracker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ local HaveQuestData = HaveQuestData
local isWorldQuest = QuestUtils_IsQuestWorldQuest
local GetQuestInfoByQuestID = C_TaskQuest.GetQuestInfoByQuestID
local GetQuestTimeLeftMinutes = C_TaskQuest.GetQuestTimeLeftMinutes
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID or C_TaskQuest.GetQuestsOnMap

local _

Expand Down Expand Up @@ -1098,12 +1099,12 @@ function SlashCmdList.WQTRACKER (msg, editbox)
WorldQuestTracker:Msg("Character level too low for shadowlands, minimum is 51 for alts.")
end

local bastionQuests = C_TaskQuest.GetQuestsForPlayerByMapID(1533, 1533)
local bastionQuests = GetQuestsForPlayerByMapID(1533, 1533)
WorldQuestTracker:Msg("Finding quests on Bastion Map")
if (bastionQuests and type(bastionQuests) == "table") then
WorldQuestTracker:Msg("Found quests, amount:", #bastionQuests)
else
WorldQuestTracker:Msg("Blizzard's GetQuestsForPlayerByMapID() returned invalid data.")
WorldQuestTracker:Msg("Blizzard's GetQuestsOnMap() returned invalid data.")
end

elseif (msg == "debug") then
Expand Down
4 changes: 2 additions & 2 deletions WorldQuestTracker.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 110002
## Interface-Mainline: 110002
## Interface: 110005
## Interface-Mainline: 110005
## Interface-Wrath: 30402

## Title: World Quest Tracker
Expand Down
4 changes: 2 additions & 2 deletions WorldQuestTracker_GroupFinder.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local L = DF.Language.GetLanguageTable(addonId)
local ff = WorldQuestTrackerFinderFrame
local rf = WorldQuestTrackerRareFrame


local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID or C_TaskQuest.GetQuestsOnMap

ff.cannot_group_quest = {}

Expand Down Expand Up @@ -1415,7 +1415,7 @@ ff:SetScript("OnEvent", function (self, event, questID, arg2, arg3)
end)

function ff.CheckForQuestsInTheArea()
local allQuestsInTheMap = C_TaskQuest.GetQuestsForPlayerByMapID(WorldQuestTracker.GetCurrentStandingMapAreaID())
local allQuestsInTheMap = GetQuestsForPlayerByMapID(WorldQuestTracker.GetCurrentStandingMapAreaID())
if (allQuestsInTheMap) then
for index, questInfo in ipairs(allQuestsInTheMap) do
local questId = questInfo.questId
Expand Down
6 changes: 3 additions & 3 deletions WorldQuestTracker_MapAPI.lua
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ local GetItemInfo = C_Item and C_Item.GetItemInfo or GetItemInfo
local L = DF.Language.GetLanguageTable(addonId)

local _
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID or C_TaskQuest.GetQuestsOnMap
local isWorldQuest = QuestUtils_IsQuestWorldQuest
local GetNumQuestLogRewardCurrencies = WorldQuestTrackerAddon.GetNumQuestLogRewardCurrencies
local GetQuestLogRewardInfo = GetQuestLogRewardInfo
Expand Down Expand Up @@ -241,7 +241,7 @@ function WorldQuestTracker.GetAllWorldQuests_Ids()
local taskInfo = GetQuestsForPlayerByMapID (mapId)
if (taskInfo and #taskInfo > 0) then
for i, info in ipairs (taskInfo) do
local questID = info.questId
local questID = info.questID
if (HaveQuestData (questID)) then
local isWorldQuest = isWorldQuest(questID)
if (isWorldQuest) then
Expand Down Expand Up @@ -399,7 +399,7 @@ function WorldQuestTracker.PreloadWorldQuestsForMap(mapID)
local taskInfo = GetQuestsForPlayerByMapID(mapID)
if (taskInfo and #taskInfo > 0) then
for i, info in ipairs(taskInfo) do
local questID = info.questId
local questID = info.questID
local bIsWorldQuest = isWorldQuest(questID)
if (bIsWorldQuest) then
if (not HaveQuestData(questID) or not HaveQuestRewardData(questID)) then
Expand Down
4 changes: 3 additions & 1 deletion WorldQuestTracker_MapChange.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ if (not WorldQuestTracker) then
return
end

local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID or C_TaskQuest.GetQuestsOnMap

--framework
---@type detailsframework
local DF = _G ["DetailsFramework"]
Expand All @@ -23,7 +25,7 @@ local check_for_quests_on_unknown_map = function()
local mapID = WorldMapFrame.mapID

if (not WorldQuestTracker.MapData.WorldQuestZones[mapID] and not WorldQuestTracker.IsWorldQuestHub(mapID)) then
local taskInfo = C_TaskQuest.GetQuestsForPlayerByMapID(mapID, mapID)
local taskInfo = GetQuestsForPlayerByMapID(mapID, mapID)
if (taskInfo and #taskInfo > 0) then
--> there's quests on this map
WorldQuestTracker.MapData.WorldQuestZones[mapID] = true
Expand Down
8 changes: 4 additions & 4 deletions WorldQuestTracker_WorldMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ local HereBeDragons = LibStub("HereBeDragons-2.0")
local CONST_QUEST_LOADINGTIME = 1.333
local _
local isWorldQuest = QuestUtils_IsQuestWorldQuest
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID or C_TaskQuest.GetQuestsOnMap
local IsQuestCriteriaForBounty = C_QuestLog.IsQuestCriteriaForBounty

local faction_frames = {}
Expand Down Expand Up @@ -98,7 +98,7 @@ local loadQuestData = function()

if (taskInfo and #taskInfo > 0) then
for i, info in ipairs(taskInfo) do
local questID = info.questId
local questID = info.questID
if (not WorldQuestTracker.HaveDataForQuest(questID) or not HaveQuestRewardData(questID)) then
C_TaskQuest.RequestPreloadRewardData(questID)
end
Expand Down Expand Up @@ -1421,7 +1421,7 @@ function WorldQuestTracker.UpdateWorldQuestsOnWorldMap(noCache, showFade, isQues

if (taskInfo and #taskInfo > 0) then
for i, info in ipairs(taskInfo) do
local questID = info.questId
local questID = info.questID
local canUpdateQuest = false

if (not questList) then
Expand Down Expand Up @@ -1807,7 +1807,7 @@ function WorldQuestTracker.GetQuestDataFromCache(questID, bCreateQuestData)
local taskInfo = GetQuestsForPlayerByMapID(mapId, mapId)
if (taskInfo and #taskInfo > 0) then
for i, info in ipairs(taskInfo) do
local thisTaskQuestId = info.questId
local thisTaskQuestId = info.questID
if (thisTaskQuestId == questID) then
local title, factionID, tagID, tagName, worldQuestType, rarity, isElite, tradeskillLineIndex, allowDisplayPastCritical, gold, goldFormated, rewardName, rewardTexture, numRewardItems, itemName, itemTexture, itemLevel, quantity, quality, isUsable, itemID, isArtifact, artifactPower, isStackable, stackAmount = WorldQuestTracker.GetOrLoadQuestData(questID, true)
local timeLeft = WorldQuestTracker.GetQuest_TimeLeft(questID)
Expand Down
5 changes: 2 additions & 3 deletions WorldQuestTracker_ZoneMap.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ end
local L = DF.Language.GetLanguageTable(addonId)

local _
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID or C_TaskQuest.GetQuestsOnMap
local isWorldQuest = QuestUtils_IsQuestWorldQuest
local GetNumQuestLogRewardCurrencies = WorldQuestTrackerAddon.GetNumQuestLogRewardCurrencies
local GetQuestLogRewardInfo = GetQuestLogRewardInfo
Expand Down Expand Up @@ -906,8 +906,7 @@ function WorldQuestTracker.UpdateZoneWidgets(forceUpdate)
local needAnotherUpdate = false

for i, info in ipairs(taskInfo) do
local questID = info.questId

local questID = info.questID
local isWorldQuest = isWorldQuest(questID)
if (isWorldQuest) then
if (HaveQuestData(questID)) then
Expand Down
3 changes: 3 additions & 0 deletions libs/DF/definitions.lua
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,9 @@
---@field ScriptHookMixin df_scripthookmixin
---@field EditorMixin df_editormixin
---@field PoolMixin df_pool
---@field LineIndicatorMixin df_lineindicator
---@field ScrollBoxFunctions df_scrollboxmixin
---@field LayoutFrame df_framelayout
---@field ClassCache {ID:number, Name:string, FileString:string, Texture:string, TexCoord:number[]}[] only available after calling GetClassList()
---@field Math df_math
---@field FontOutlineFlags table<outline, boolean>
Expand Down Expand Up @@ -357,6 +359,7 @@
---@field CreateTimeLineFrame fun(self:table, parent:frame, name:string, timelineOptions:df_timeline_options, elapsedtimeOptions:df_elapsedtime_options) : df_timeline
---@field CreateElapsedTimeFrame fun(self:table, parent:frame, name:string?, options:df_elapsedtime_options?) : df_elapsedtime
---@field GetClassTCoordsAndTexture fun(self:table, class:string) : number, number, number, number, string return the class icon texture coordinates and texture file path
---@field GetClassColorByClassId fun(self:table, classId:number) : number, number, number return the class color by classId
---@field MakeStringFromSpellId fun(self:table, spellId:any) : string return a string with the spell icon and name using escape codes
---@field AddClassIconToText fun(self:table, text:string, playerName:string, englishClassName:string, useSpec:boolean?, iconSize:number?) : string wrap 'text' with the class icon of 'playerName' using |T|t scape codes
---@field RemoveRealNameFromName fun(self:table, name:string) : string remove the realm name from a name string
Expand Down
10 changes: 9 additions & 1 deletion libs/DF/elapsedtime.lua
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ detailsFramework.TimeLineElapsedTimeFunctions = {
end
end,

SetScrollChild = function(self, scrollChild)
self.scrollChild = scrollChild
end,

Refresh = function(self, elapsedTime, scale)
if (not elapsedTime) then
--invalid data passed
Expand Down Expand Up @@ -118,7 +122,7 @@ detailsFramework.TimeLineElapsedTimeFunctions = {
label:SetText(detailsFramework:IntegerToTimer(floor(secondsOfTime)))

if (label.line:IsShown()) then
label.line:SetHeight(parent:GetParent():GetHeight())
label.line:SetHeight(self.scrollChild:GetHeight())
end

label:Show()
Expand All @@ -128,13 +132,15 @@ detailsFramework.TimeLineElapsedTimeFunctions = {

---@class df_elapsedtime : frame, df_elapsedtime_mixin, df_optionsmixin
---@field labels table<number, df_elapsedtime_label>
---@field scrollChild frame

---creates a frame to show the elapsed time in a row
---@param parent frame
---@param name string?
---@param options df_elapsedtime_options?
---@return df_elapsedtime
function detailsFramework:CreateElapsedTimeFrame(parent, name, options)
---@type df_elapsedtime
local elapsedTimeFrame = CreateFrame("frame", name, parent, "BackdropTemplate")

detailsFramework:Mixin(elapsedTimeFrame, detailsFramework.OptionsFunctions)
Expand All @@ -146,6 +152,8 @@ function detailsFramework:CreateElapsedTimeFrame(parent, name, options)
elapsedTimeFrame:SetBackdrop(elapsedTimeFrame.options.backdrop)
elapsedTimeFrame:SetBackdropColor(unpack(elapsedTimeFrame.options.backdrop_color))

elapsedTimeFrame.scrollChild = parent

elapsedTimeFrame.labels = {}

return elapsedTimeFrame
Expand Down
24 changes: 19 additions & 5 deletions libs/DF/fw.lua
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


local dversion = 574
local dversion = 575
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)

Expand Down Expand Up @@ -1365,6 +1365,19 @@ function DF:AddColorToText(text, color) --wrap text with a color
return text
end

function DF:GetClassColorByClassId(classId)
local classInfo = C_CreatureInfo.GetClassInfo(classId)
if (classInfo) then
local color = RAID_CLASS_COLORS[classInfo.classFile]
if (color) then
return color.r, color.g, color.b
else
return 1, 1, 1
end
end
return 1, 1, 1
end

---receives a string 'text' and a class name and return the string wrapped with the class color using |c and |r scape codes
---@param self table
---@param text string
Expand Down Expand Up @@ -4739,6 +4752,7 @@ DF.ClassIndexToFileName = {
[13] = "EVOKER",
}

--GetNumClasses()

DF.ClassFileNameToIndex = {
["WARRIOR"] = 1,
Expand Down Expand Up @@ -5708,14 +5722,14 @@ local sendTimeBarNotification = function(token, barType, id, msg, timer, icon, s
end

local createBossModsCallback = function()
if (_G.DBM) then
if (false and _G.DBM) then
local DBM = _G.DBM

--phase change
local phaseChangeCallback = function(event, mod, modId, phase, encounterId, stageTotal)
sendPhaseNotification(phase)
end
DBM:RegisterCallback("DBM_SetStage", phaseChangeCallback)
--DBM:RegisterCallback("DBM_SetStage", phaseChangeCallback)

--time bars
local timerChangeCallback = function(bar_type, id, msg, timer, icon, bartype, spellId, colorId, modid)
Expand All @@ -5733,12 +5747,12 @@ local createBossModsCallback = function()
end
end

DBM:RegisterCallback("DBM_TimerStart", timerChangeCallback)
--DBM:RegisterCallback("DBM_TimerStart", timerChangeCallback)
end

local BigWigsLoader = BigWigsLoader

if (BigWigsLoader and not _G.DBM) then
if (BigWigsLoader) then -- and not _G.DBM
--Bigwigs change the phase of an encounter
if (BigWigsLoader.RegisterMessage) then
local t = {}
Expand Down
1 change: 1 addition & 0 deletions libs/DF/line_indicator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ end
---@field lineIndicatorLineHeight number
---@field lineIndicatorLineWidth number
---@field lineIndicatorPixelPerSecond number
---@field lineIndicatorMouseEnabled boolean
---@field lineIndicatorColor any
---@field lineIndicatorValueFontString fontstring
---@field LineIndicatorConstructor fun(self:df_lineindicator)
Expand Down
1 change: 1 addition & 0 deletions libs/DF/slider.lua
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,7 @@ end
---@field SetSwitchFunction fun(self:df_button, newOnSwitchFunction: function)
---@field GetCapsule fun(self:df_button):df_button capsule only exists in the actual frame of the encapsulated widget
---@field SetCheckedTexture fun(self:df_button, texture:string)
---@field SetChecked fun(self:df_button, value:boolean)


function DF:CreateSwitch(parent, onSwitch, defaultValue, width, height, leftText, rightText, member, name, colorInverted, switchFunc, returnFunc, withLabel, switch_template, label_template)
Expand Down
Loading

0 comments on commit 9cbcf71

Please sign in to comment.