Skip to content

Commit

Permalink
Quick 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 65e9c35 commit 15ff376
Show file tree
Hide file tree
Showing 7 changed files with 266 additions and 71 deletions.
4 changes: 3 additions & 1 deletion Plater.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5673,6 +5673,7 @@ function Plater.OnInit() --private --~oninit ~init
for classID = 1, MAX_CLASSES do
local _, classFile = GetClassInfo(classID)
CLASS_INFO_CACHE[classFile] = {}
local GetNumSpecializationsForClassID = GetNumSpecializationsForClassID or C_SpecializationInfo.GetNumSpecializationsForClassID --10.0.5
for i = 1, GetNumSpecializationsForClassID(classID) do
local specID, maleName, _, iconID, role = GetSpecializationInfoForClassID(classID, i, 2) -- male
local _, femaleName, _, iconID, role = GetSpecializationInfoForClassID(classID, i, 3) -- female
Expand Down Expand Up @@ -10101,7 +10102,8 @@ end
if IS_WOW_PROJECT_MAINLINE then
local mapId = C_Map.GetBestMapForUnit ("player")
if (mapId) then
local worldQuests = C_TaskQuest.GetQuestsForPlayerByMapID (mapId)
local GetQuestsForPlayerByMapID = C_TaskQuest.GetQuestsForPlayerByMapID or C_TaskQuest.GetQuestsOnMap
local worldQuests = GetQuestsForPlayerByMapID(mapId)
if (type (worldQuests) == "table") then
for i, questTable in ipairs (worldQuests) do
local x, y, floor, numObjectives, questId, inProgress = questTable.x, questTable.y, questTable.floor, questTable.numObjectives, questTable.questId, questTable.inProgress
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
14 changes: 14 additions & 0 deletions libs/DF/fw.lua
Original file line number Diff line number Diff line change
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
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
Loading

0 comments on commit 15ff376

Please sign in to comment.