Skip to content

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Tercioo committed Dec 19, 2024
1 parent 924c6b4 commit 86f9458
Show file tree
Hide file tree
Showing 29 changed files with 1,374 additions and 451 deletions.
4 changes: 2 additions & 2 deletions WorldQuestTracker.toc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## Interface: 110005
## Interface-Mainline: 110005
## Interface: 110007
## Interface-Mainline: 110007
## Interface-Wrath: 30402

## Title: World Quest Tracker
Expand Down
2 changes: 1 addition & 1 deletion libs/DF/LibDFramework-1.0.toc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Interface: 110002
## Interface: 110007
## Title: Lib: LibDFramework-1.0
## Notes: Base Framework for many Addons

Expand Down
2 changes: 1 addition & 1 deletion libs/DF/auras.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local GetSpellTabInfo = GetSpellTabInfo or function(tabLine) local skillLine = C
local unpack = unpack
local CreateFrame = CreateFrame
local GameTooltip = GameTooltip
local tremove = tremove
local tremove = table.remove

local CONST_MAX_SPELLS = 500000

Expand Down
63 changes: 63 additions & 0 deletions libs/DF/buildmenu.lua
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,36 @@ local setExecuteProperties = function(parent, widget, widgetTable, currentXOffse
return maxColumnWidth, maxWidgetWidth, latestInlineWidget
end

local setImageProperties = function(parent, widget, widgetTable, currentXOffset, currentYOffset)
--.texture .width .height .filterType .texcoord
if (type(widgetTable.texture) == "table") then
local r, g, b, a = detailsFramework:ParseColors(widgetTable.texture)
widget:SetColorTexture(r, g, b, a)
else
widget:SetTexture(widgetTable.texture, "CLAMP", "CLAMP", widgetTable.filterType)
end

widget:SetSize(widgetTable.width, widgetTable.height)

local left, right, top, bottom = 0, 1, 0, 1
if (widgetTable.texcoord) then
left, right, top, bottom = unpack(widgetTable.texcoord)
end
widget:SetTexCoord(left, right, top, bottom)

if (widgetTable.vertexcolor) then
local r, g, b, a = detailsFramework:ParseColors(widgetTable.vertexcolor)
widget:SetVertexColor(r, g, b, a)
else
widget:SetVertexColor(1, 1, 1, 1)
end

setWidgetId(parent, widgetTable, widget)

widget:ClearAllPoints()
widget:SetPoint("topleft", parent, "topleft", currentXOffset, currentYOffset)
end

local setTextEntryProperties = function(parent, widget, widgetTable, currentXOffset, currentYOffset, template, widgetWidth, widgetHeight, bAlignAsPairs, nAlignAsPairsLength, valueChangeHook, maxColumnWidth, maxWidgetWidth, textTemplate, latestInlineWidget)
widget._get = widgetTable.get
widget.text = widgetTable.get()
Expand Down Expand Up @@ -889,6 +919,7 @@ function detailsFramework:SetAsOptionsPanel(frame)
["button"] = {}, -- "execute"
["textentry"] = {}, --
["label"] = {}, --"text"
["image"] = {},
}
frame.widgetids = {}
frame.GetWidgetById = getFrameById
Expand Down Expand Up @@ -997,6 +1028,15 @@ local getMenuWidgetVolative = function(parent, widgetType, indexTable)
widgetObject:ClearHooks()
end
indexTable[widgetType] = indexTable[widgetType] + 1

elseif (widgetType == "image") then
widgetObject = parent.widget_list_by_type[widgetType][indexTable[widgetType]]
if (not widgetObject) then
widgetObject = parent:CreateTexture("$parentWidget" .. widgetType .. indexTable[widgetType], "overlay")
table.insert(parent.widget_list, widgetObject)
table.insert(parent.widget_list_by_type[widgetType], widgetObject)
end
indexTable[widgetType] = indexTable[widgetType] + 1
end

--if the widget is inside the no combat table, remove it
Expand Down Expand Up @@ -1251,6 +1291,15 @@ function detailsFramework:BuildMenuVolatile(parent, menuOptions, xOffset, yOffse

maxColumnWidth, maxWidgetWidth = setTextEntryProperties(parent, textentry, widgetTable, currentXOffset, currentYOffset, buttonTemplate, widgetWidth, widgetHeight, bAlignAsPairs, nAlignAsPairsLength, valueChangeHook, maxColumnWidth, maxWidgetWidth, textTemplate)
amountLineWidgetAdded = amountLineWidgetAdded + 1

--image
elseif (widgetTable.type == "image") then
local image = getMenuWidgetVolative(parent, "image", widgetIndexes)
widgetCreated = image

setImageProperties(parent, image, widgetTable, currentXOffset, currentYOffset)

amountLineWidgetAdded = amountLineWidgetAdded + 1
end --end loop

if (widgetTable.nocombat) then
Expand Down Expand Up @@ -1565,6 +1614,20 @@ function detailsFramework:BuildMenu(parent, menuOptions, xOffset, yOffset, heigh

widgetCreated = textentry
amountLineWidgetAdded = amountLineWidgetAdded + 1

elseif (widgetTable.type == "image") then
local image = parent:CreateTexture("$parentMenuImage" .. index, "overlay")

setImageProperties(parent, image, widgetTable, currentXOffset, currentYOffset)

currentYOffset = currentYOffset - widgetTable.height + 10

--store the widget created into the overall table and the widget by type
table.insert(parent.widget_list, image)
table.insert(parent.widget_list_by_type.textentry, image)

widgetCreated = image
amountLineWidgetAdded = amountLineWidgetAdded + 1
end

if (widgetTable.nocombat) then
Expand Down
12 changes: 6 additions & 6 deletions libs/DF/button.lua
Original file line number Diff line number Diff line change
Expand Up @@ -655,7 +655,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)

if (object.capsule_textalign) then
if (object.icon) then
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftpadding or 0), -1)
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftPadding or 0), -1)

elseif (object.capsule_textalign == "left") then
button.text:SetPoint("left", button, "left", 3, -1)
Expand All @@ -668,7 +668,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)
end
else
if (object.icon) then
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftpadding or 0), -1)
object.icon:SetPoint("left", button, "left", 5 + (object.icon.leftPadding or 0), -1)
else
button.text:SetPoint("center", button,"center", 1, -1)
end
Expand Down Expand Up @@ -729,7 +729,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)

if (object.capsule_textalign) then
if (object.icon) then
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftpadding or 0), 0)
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftPadding or 0), 0)

elseif (object.capsule_textalign == "left") then
button.text:SetPoint("left", button, "left", 2, 0)
Expand All @@ -742,7 +742,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)
end
else
if (object.icon) then
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftpadding or 0), 0)
object.icon:SetPoint("left", button, "left", 4 + (object.icon.leftPadding or 0), 0)
else
button.text:SetPoint("center", button,"center", 0, 0)
end
Expand Down Expand Up @@ -828,7 +828,7 @@ function ButtonMetaFunctions:SetTemplate(template)

if (template.icon) then
local iconInfo = template.icon
self:SetIcon(iconInfo.texture, iconInfo.width, iconInfo.height, iconInfo.layout, iconInfo.texcoord, iconInfo.color, iconInfo.textdistance, iconInfo.leftpadding)
self:SetIcon(iconInfo.texture, iconInfo.width, iconInfo.height, iconInfo.layout, iconInfo.texcoord, iconInfo.color, iconInfo.textdistance, iconInfo.leftPadding)
end

if (template.textsize) then
Expand Down Expand Up @@ -1543,4 +1543,4 @@ end
local closeButton = detailsFramework:CreateCloseButton(frame, "$parentCloseButton")
closeButton:SetPoint("topright", frame, "topright", 0, 0)
--]=]
--]=]
6 changes: 3 additions & 3 deletions libs/DF/charts.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1459,8 +1459,8 @@ detailsFramework.MultiChartFrameMixin = {
biggestAverage[i] = {average = chartFrame.average, chartIndex = i}
end

--sort the averages by the biggest average placing the biggest average in the first position
table.sort(biggestAverage, function(a, b) return a.average > b.average end)
-- sort the averages by the biggest average placing the biggest average in the first position
table.sort(biggestAverage, function(a, b) if not (a.average and b.average) then return a.average ~= nil end return a.average > b.average end)

local minValue, multiChartMaxValue = multiChartFrame:GetMinMaxValues()
local plotAreaWidth = multiChartFrame.plotFrame:GetWidth() --if there's no axis, the plotFrame has no width
Expand Down Expand Up @@ -1518,4 +1518,4 @@ function detailsFramework:CreateGraphicMultiLineFrame(parent, name)

createPlotFrame(chartFrame) --creates chartFrame.plotFrame
return chartFrame
end
end
54 changes: 50 additions & 4 deletions libs/DF/cooltip.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ end

--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 28
local version = 30

local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
Expand Down Expand Up @@ -1053,6 +1053,16 @@ function DF:CreateCoolTip()

if (gameCooltip.OptionsTable.TextSize and not leftTextSettings[6]) then
DF:SetFontSize(menuButton.leftText, gameCooltip.OptionsTable.TextSize)
elseif (leftTextSettings[6]) then
DF:SetFontSize(menuButton.leftText, leftTextSettings[6])
else
DF:SetFontSize(menuButton.leftText, 10)
end

if (leftTextSettings[8]) then
DF:SetFontOutline(menuButton.leftText, leftTextSettings[8])
else
DF:SetFontOutline(menuButton.leftText, "NONE")
end

if (gameCooltip.OptionsTable.LeftTextWidth) then
Expand Down Expand Up @@ -1160,6 +1170,20 @@ function DF:CreateCoolTip()
DF:SetFontSize(menuButton.rightText, gameCooltip.OptionsTable.TextSize)
end

if (gameCooltip.OptionsTable.TextSize and not rightTextSettings[6]) then
DF:SetFontSize(menuButton.rightText, gameCooltip.OptionsTable.TextSize)
elseif (rightTextSettings[6]) then
DF:SetFontSize(menuButton.rightText, rightTextSettings[6])
else
DF:SetFontSize(menuButton.rightText, 10)
end

if (rightTextSettings[8]) then
DF:SetFontOutline(menuButton.rightText, rightTextSettings[8])
else
DF:SetFontOutline(menuButton.rightText, "NONE")
end

if (gameCooltip.OptionsTable.RightTextWidth) then
menuButton.rightText:SetWidth(gameCooltip.OptionsTable.RightTextWidth)
else
Expand Down Expand Up @@ -2424,6 +2448,11 @@ function DF:CreateCoolTip()
end

function gameCooltip:SetMyPoint(host, xOffset, yOffset)
if (host and xOffset == "cursor") then
frame1.attachToCursor = true
return
end

local moveX = xOffset or 0
local moveY = yOffset or 0
local anchor = gameCooltip.OptionsTable.Anchor or gameCooltip.Host
Expand Down Expand Up @@ -2592,7 +2621,11 @@ function DF:CreateCoolTip()
end

gameCooltip.Host = frame
gameCooltip.frame1:SetFrameLevel(frame:GetFrameLevel() + 1)
if (not frame.GetFrameLevel) then
gameCooltip.frame1:SetFrameLevel(frame:GetParent():GetFrameLevel() + 1)
else
gameCooltip.frame1:SetFrameLevel(frame:GetFrameLevel() + 1)
end

--defaults
myPoint = myPoint or gameCooltip.OptionsTable.MyAnchor or "bottom"
Expand Down Expand Up @@ -2766,6 +2799,8 @@ function DF:CreateCoolTip()
gameCooltip:HideSelectedTexture(frame1)
gameCooltip:HideSelectedTexture(frame2)

frame1.attachToCursor = false

gameCooltip:HideRoundedCorner()
GameCooltip.frame1:SetBorderCornerColor(unpack(gameCooltip.RoundedFramePreset.border_color))
GameCooltip.frame2:SetBorderCornerColor(unpack(gameCooltip.RoundedFramePreset.border_color))
Expand Down Expand Up @@ -3677,10 +3712,19 @@ function DF:CreateCoolTip()
end

if (gameCooltip.Type == 1 or gameCooltip.Type == 2) then
return gameCooltip:BuildTooltip()
gameCooltip:BuildTooltip()

elseif (gameCooltip.Type == 3) then
return gameCooltip:BuildCooltip()
gameCooltip:BuildCooltip()
end

if (frame1.attachToCursor) then
frame1:SetScript("OnUpdate", function()
frame1:ClearAllPoints()
frame1:SetPoint("bottom", UIParent, "bottomleft", DF:GetCursorPosition())
end)
frame1:ClearAllPoints()
frame1:SetPoint("bottom", UIParent, "bottomleft", DF:GetCursorPosition())
end
end

Expand All @@ -3694,6 +3738,8 @@ function DF:CreateCoolTip()
DF:FadeFrame(frame1, 1)
DF:FadeFrame(frame2, 1)

frame1:SetScript("OnUpdate", nil)

--release custom icon texture objects, these are TextureObject passed with AddIcon() instead of a texture path or textureId
for i = 1, #frame1.Lines do
local menuButton = frame1.Lines[i]
Expand Down
Loading

0 comments on commit 86f9458

Please sign in to comment.