Libraries update

This commit is contained in:
Tercio Jose
2024-08-16 13:34:59 -03:00
committed by andrew6180
parent 16fd6de6f9
commit 214f0b2d88
6 changed files with 59 additions and 18 deletions
+38 -9
View File
@@ -20,7 +20,7 @@ local IsPassiveSpell = IsPassiveSpell
--api locals
local PixelUtil = PixelUtil or DFPixelUtil
local version = 26
local version = 27
local CONST_MENU_TYPE_MAINMENU = "main"
local CONST_MENU_TYPE_SUBMENU = "sub"
@@ -37,7 +37,7 @@ function DF:CreateCoolTip()
local defaultBackdrop = {bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1,
tile = true, tileSize = 16, insets = {left = 0, right = 0, top = 0, bottom = 0}}
local defaultBackdropColor = {0.1215, 0.1176, 0.1294, 0.8000}
local defaultBackdropColor = {0.1215, 0.1176, 0.1294, 0.9500}
local defaultBackdropBorderColor = {0.05, 0.05, 0.05, 1}
local defaultTexCoord = {0, 1, 0, 1}
@@ -136,7 +136,8 @@ function DF:CreateCoolTip()
["TextFont"] = true,
["TextColor"] = true,
["TextColorRight"] = true,
["TextShadow"] = true,
["TextShadow"] = true, --text shadow is doing the text outline
["TextActuallyShadow"] = true, --text shadow which is the actually text shadow
["LeftTextWidth"] = true,
["RightTextWidth"] = true,
["LeftTextHeight"] = true,
@@ -181,6 +182,10 @@ function DF:CreateCoolTip()
["FrameHeightSizeOffset"] = "HeighMod",
["FrameHeightSizeOffsetSub"] = "HeighModSub",
["TextOutline"] = "TextShadow",
["TextSilhouette"] = "TextActuallyShadow",
["TextContour"] = "TextActuallyShadow",
--space between the tooltip's left side and the start of the line
["LeftPadding"] = "LeftBorderSize",
@@ -1076,6 +1081,17 @@ function DF:CreateCoolTip()
menuButton.leftText:SetFont(gameCooltip.defaultFont, leftTextSettings[6] or gameCooltip.OptionsTable.TextSize or 10, leftTextSettings[8] or gameCooltip.OptionsTable.TextShadow)
end
--text shadow color
if (leftTextSettings[11]) then
local shadow_r, shadow_g, shadow_b, shadow_a = DF:ParseColors(leftTextSettings[11])
menuButton.leftText:SetShadowColor(shadow_r, shadow_g, shadow_b, shadow_a)
elseif (gameCooltip.OptionsTable.TextActuallyShadow) then
local shadow_r, shadow_g, shadow_b, shadow_a = DF:ParseColors(gameCooltip.OptionsTable.TextActuallyShadow)
menuButton.leftText:SetShadowColor(shadow_r, shadow_g, shadow_b, shadow_a)
else
menuButton.leftText:SetShadowColor(0, 0, 0, 1)
end
local heightMod = gameCooltip.OptionsTable.TextHeightMod or 0
menuButton.leftText:SetPoint("center", menuButton.leftIcon, "center", 0, 0 + heightMod)
menuButton.leftText:SetPoint("left", menuButton.leftIcon, "right", 3, 0 + heightMod)
@@ -1161,6 +1177,17 @@ function DF:CreateCoolTip()
else
menuButton.rightText:SetFont(gameCooltip.defaultFont, rightTextSettings[6] or gameCooltip.OptionsTable.TextSize or 10, rightTextSettings[8] or gameCooltip.OptionsTable.TextShadow)
end
--text shadow color
if (rightTextSettings[11]) then
local shadow_r, shadow_g, shadow_b, shadow_a = DF:ParseColors(rightTextSettings[11])
menuButton.rightText:SetShadowColor(shadow_r, shadow_g, shadow_b, shadow_a)
elseif (gameCooltip.OptionsTable.TextActuallyShadow) then
local shadow_r, shadow_g, shadow_b, shadow_a = DF:ParseColors(gameCooltip.OptionsTable.TextActuallyShadow)
menuButton.rightText:SetShadowColor(shadow_r, shadow_g, shadow_b, shadow_a)
else
menuButton.rightText:SetShadowColor(0, 0, 0, 1)
end
else
menuButton.rightText:SetText("")
end
@@ -1991,7 +2018,7 @@ function DF:CreateCoolTip()
--mana range
--instant cooldown
gameCooltip:ShowRoundedCorner()
--gameCooltip:ShowRoundedCorner()
end
end
end
@@ -3333,13 +3360,13 @@ function DF:CreateCoolTip()
--adds a line.
--only works with cooltip type1 and 2 (tooltip and tooltip with bars)
--parameters: left text, right text[, L color R, L color G, L color B, L color A[, R color R, R color G, R color B, R color A[, wrap]]]
function gameCooltip:AddDoubleLine (leftText, rightText, menuType, ColorR1, ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight) --ãddline ~addline
return gameCooltip:AddLine(leftText, rightText, menuType, ColorR1, ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight)
function gameCooltip:AddDoubleLine (leftText, rightText, menuType, ColorR1, ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight, textContour) --ãddline ~addline
return gameCooltip:AddLine(leftText, rightText, menuType, ColorR1, ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight, textContour)
end
--adds a line for tooltips
--AddLine creates a new line on the tooltip
function gameCooltip:AddLine(leftText, rightText, menuType, ColorR1, ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight)
function gameCooltip:AddLine(leftText, rightText, menuType, ColorR1, ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight, textContour)
--check data integrity
local leftTextType = type(leftText)
if (leftTextType ~= "string") then
@@ -3360,7 +3387,7 @@ function DF:CreateCoolTip()
end
if (type(ColorR1) ~= "number") then
ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight = ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace
ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag, textWidth, textHeight, textContour = ColorG1, ColorB1, ColorA1, ColorR2, ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag
if (type(ColorR1) == "boolean" or not ColorR1) then
ColorR1, ColorG1, ColorB1, ColorA1 = 0, 0, 0, 0
else
@@ -3369,7 +3396,7 @@ function DF:CreateCoolTip()
end
if (type(ColorR2) ~= "number") then
fontSize, fontFace, fontFlag, textWidth, textHeight = ColorG2, ColorB2, ColorA2, fontSize, fontFace
fontSize, fontFace, fontFlag, textWidth, textHeight, textContour = ColorG2, ColorB2, ColorA2, fontSize, fontFace, fontFlag
if (type(ColorR2) == "boolean" or not ColorR2) then
ColorR2, ColorG2, ColorB2, ColorA2 = 0, 0, 0, 0
else
@@ -3470,6 +3497,7 @@ function DF:CreateCoolTip()
lineTable_Left[8] = fontFlag
lineTable_Left[9] = textWidth
lineTable_Left[10] = textHeight
lineTable_Left[11] = textContour
lineTable_Right[1] = rightText
lineTable_Right[2] = ColorR2
@@ -3481,6 +3509,7 @@ function DF:CreateCoolTip()
lineTable_Right[8] = fontFlag
lineTable_Right[9] = textWidth
lineTable_Right[10] = textHeight
lineTable_Right[11] = textContour
end
function gameCooltip:AddSpecial(widgetType, index, subIndex, ...)
+3
View File
@@ -316,6 +316,9 @@
---@field CreateGraphicLineFrame fun(self:table, parent:frame, name:string) : df_chart
---@field CreateFlashAnimation fun(self:table, frame:uiobject, onFinishFunc:function?, onLoopFunc:function?) : animationgroup
---@field CreateTimeBar fun(self:table, parent:frame, texture:texturepath|textureid, width:number?, height:number?, value:number?, member:string?, name:string?) : df_timebar
---@field CreatePool fun(self:table, func:function, ...) : table
---@field CreateObjectPool fun(self:table, func:function, ...) : table alias of CreatePool
--[=[
Wrapped objects: when using the following functions, the object will be wrapped in a table, e.g. detailsFramework:CreateButton() will return a table with the button, the button will be accessible through the "button" key.
+7 -1
View File
@@ -1,6 +1,6 @@
local dversion = 561
local dversion = 562
local major, minor = "DetailsFramework-1.0", dversion
local DF, oldminor = LibStub:NewLibrary(major, minor)
@@ -2758,7 +2758,13 @@ DF.button_templates["STANDARD_GRAY"] = {
backdropcolor = {0.2, 0.2, 0.2, 0.502},
backdropbordercolor = {0, 0, 0, 0.5},
onentercolor = {0.4, 0.4, 0.4, 0.502},
}
DF.button_templates["OPAQUE_DARK"] = {
backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Buttons\WHITE8X8]], tileSize = 8, tile = true},
backdropcolor = {0.2, 0.2, 0.2, 1},
backdropbordercolor = {0, 0, 0, 1},
onentercolor = {0.4, 0.4, 0.4, 1},
}
--sliders
+1 -1
View File
@@ -63,7 +63,7 @@ detailsFramework.TooltipHandlerMixin = {
if (tooltipText and tooltipText ~= "") then
GameCooltip:Preset(2)
GameCooltip:AddLine(tooltipText)
GameCooltip:ShowRoundedCorner()
--GameCooltip:ShowRoundedCorner() --disabled rounded corners by default
GameCooltip:ShowCooltip(getFrame(self), "tooltip")
end
end,
+9 -6
View File
@@ -5313,11 +5313,14 @@ function detailsFramework:CreateTimeLineFrame(parent, name, options, timelineOpt
--create elapsed time frame
frameCanvas.elapsedTimeFrame = detailsFramework:CreateElapsedTimeFrame(frameBody, frameCanvas:GetName() and frameCanvas:GetName() .. "ElapsedTimeFrame", timelineOptions)
local thumbColor = 0.95
local scrollBackgroudColor = {0.05, 0.05, 0.05, 0.7}
--create horizontal slider
local horizontalSlider = CreateFrame("slider", frameCanvas:GetName() .. "HorizontalSlider", parent, "BackdropTemplate")
horizontalSlider.bg = horizontalSlider:CreateTexture(nil, "background")
horizontalSlider.bg:SetAllPoints(true)
horizontalSlider.bg:SetTexture(0, 0, 0, 0.5)
horizontalSlider.bg:SetColorTexture(unpack(scrollBackgroudColor))
frameCanvas.horizontalSlider = horizontalSlider
horizontalSlider:SetBackdrop(frameCanvas.options.slider_backdrop)
@@ -5327,7 +5330,7 @@ function detailsFramework:CreateTimeLineFrame(parent, name, options, timelineOpt
horizontalSlider.thumb = horizontalSlider:CreateTexture(nil, "OVERLAY")
horizontalSlider.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob")
horizontalSlider.thumb:SetSize(24, 24)
horizontalSlider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95)
horizontalSlider.thumb:SetVertexColor(thumbColor, thumbColor, thumbColor, 0.95)
horizontalSlider:SetThumbTexture(horizontalSlider.thumb)
horizontalSlider:SetOrientation("horizontal")
@@ -5348,7 +5351,7 @@ function detailsFramework:CreateTimeLineFrame(parent, name, options, timelineOpt
local scaleSlider = CreateFrame("slider", frameCanvas:GetName() .. "ScaleSlider", parent, "BackdropTemplate")
scaleSlider.bg = scaleSlider:CreateTexture(nil, "background")
scaleSlider.bg:SetAllPoints(true)
scaleSlider.bg:SetTexture(0, 0, 0, 0.5)
scaleSlider.bg:SetColorTexture(unpack(scrollBackgroudColor))
scaleSlider:Disable()
frameCanvas.scaleSlider = scaleSlider
@@ -5359,7 +5362,7 @@ function detailsFramework:CreateTimeLineFrame(parent, name, options, timelineOpt
scaleSlider.thumb = scaleSlider:CreateTexture(nil, "OVERLAY")
scaleSlider.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob")
scaleSlider.thumb:SetSize(24, 24)
scaleSlider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95)
scaleSlider.thumb:SetVertexColor(thumbColor, thumbColor, thumbColor, 0.95)
scaleSlider:SetThumbTexture(scaleSlider.thumb)
scaleSlider:SetOrientation("horizontal")
@@ -5381,7 +5384,7 @@ function detailsFramework:CreateTimeLineFrame(parent, name, options, timelineOpt
local verticalSlider = CreateFrame("slider", frameCanvas:GetName() .. "VerticalSlider", parent, "BackdropTemplate")
verticalSlider.bg = verticalSlider:CreateTexture(nil, "background")
verticalSlider.bg:SetAllPoints(true)
verticalSlider.bg:SetTexture(0, 0, 0, 0.5)
verticalSlider.bg:SetColorTexture(unpack(scrollBackgroudColor))
frameCanvas.verticalSlider = verticalSlider
verticalSlider:SetBackdrop(frameCanvas.options.slider_backdrop)
@@ -5391,7 +5394,7 @@ function detailsFramework:CreateTimeLineFrame(parent, name, options, timelineOpt
verticalSlider.thumb = verticalSlider:CreateTexture(nil, "OVERLAY")
verticalSlider.thumb:SetTexture("Interface\\Buttons\\UI-ScrollBar-Knob")
verticalSlider.thumb:SetSize(24, 24)
verticalSlider.thumb:SetVertexColor(0.6, 0.6, 0.6, 0.95)
verticalSlider.thumb:SetVertexColor(thumbColor, thumbColor, thumbColor, 0.95)
verticalSlider:SetThumbTexture(verticalSlider.thumb)
verticalSlider:SetOrientation("vertical")
+1 -1
View File
@@ -31,7 +31,7 @@ LIB_OPEN_RAID_CAN_LOAD = false
local major = "LibOpenRaid-1.0"
local CONST_LIB_VERSION = 136
local CONST_LIB_VERSION = 137
if (LIB_OPEN_RAID_MAX_VERSION) then
if (CONST_LIB_VERSION <= LIB_OPEN_RAID_MAX_VERSION) then