General development and bug fixes (see commit description).
- Fixed the deaths display, where the windows wasn't usig custom text scripts. - Fixed an issue with custom displays, where it was unable to use class colors in their texts. - More development and bug fixes on the new Mythic+ Run Completion panel. - Framework Update.
This commit is contained in:
+49
-12
@@ -481,12 +481,16 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)
|
||||
---enable the button making it clickable and not grayed out
|
||||
---@return unknown
|
||||
function ButtonMetaFunctions:Enable()
|
||||
|
||||
return self.button:Enable()
|
||||
end
|
||||
|
||||
---disable the button making it unclickable and grayed out
|
||||
---@return unknown
|
||||
function ButtonMetaFunctions:Disable()
|
||||
if (self.color_texture) then
|
||||
self.color_texture:SetVertexColor(0.14, 0.14, 0.14)
|
||||
end
|
||||
return self.button:Disable()
|
||||
end
|
||||
|
||||
@@ -733,7 +737,7 @@ detailsFramework:Mixin(ButtonMetaFunctions, detailsFramework.ScriptHookMixin)
|
||||
---receives a table where the keys are settings and the values are the values to set
|
||||
---this is the list of keys the table support:
|
||||
---width, height, icon|table, textcolor, textsize, textfont, textalign, backdrop, backdropcolor, backdropbordercolor, onentercolor, onleavecolor, onenterbordercolor, onleavebordercolor
|
||||
---@param template table
|
||||
---@param template table|string
|
||||
function ButtonMetaFunctions:SetTemplate(template)
|
||||
if (type(template) == "string") then
|
||||
template = detailsFramework:GetTemplate("button", template)
|
||||
@@ -808,6 +812,25 @@ function ButtonMetaFunctions:SetTemplate(template)
|
||||
if (template.textalign) then
|
||||
self.textalign = template.textalign
|
||||
end
|
||||
|
||||
if (template.rounded_corner) then
|
||||
self:SetBackdrop(nil)
|
||||
detailsFramework:AddRoundedCornersToFrame(self.widget or self, template.rounded_corner)
|
||||
|
||||
--check if this is a color picker button
|
||||
if (self.__iscolorpicker) then
|
||||
self.color_texture:SetTexture([[Interface\CHARACTERFRAME\TempPortraitAlphaMaskSmall]], "CLAMP", "CLAMP", "TRILINEAR")
|
||||
self.color_texture:SetDrawLayer("overlay", 7)
|
||||
self.color_texture:SetPoint("topleft", self.widget, "topleft", 2, -2)
|
||||
self.color_texture:SetPoint("bottomright", self.widget, "bottomright", -2, 2)
|
||||
|
||||
self.background_texture:SetDrawLayer("overlay", 6)
|
||||
self.background_texture:SetPoint("topleft", self.color_texture, "topleft", 2, -2)
|
||||
self.background_texture:SetPoint("bottomright", self.color_texture, "bottomright", -2, 2)
|
||||
|
||||
self.widget.texture_disabled:SetTexture([[Interface\CHARACTERFRAME\TempPortraitAlphaMaskSmall]], "CLAMP", "CLAMP", "TRILINEAR")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
------------------------------------------------------------------------------------------------------------
|
||||
@@ -857,7 +880,7 @@ end
|
||||
---@field textfont string
|
||||
---@field textsize number
|
||||
---@field icon texture created after calling SetIcon()
|
||||
---@field SetTemplate fun(self: df_button, template: table) set the button visual by a template
|
||||
---@field SetTemplate fun(self: df_button, template: table|string) set the button visual by a template
|
||||
---@field RightClick fun(self: df_button) right click the button executing its right click function
|
||||
---@field Exec fun(self: df_button) execute the button function for the left button
|
||||
---@field Disable fun(self: df_button) disable the button
|
||||
@@ -1064,6 +1087,15 @@ end
|
||||
return self.color_texture:GetVertexColor()
|
||||
end
|
||||
|
||||
---@class df_colorpickbutton : df_button
|
||||
---@field color_callback function
|
||||
---@field Cancel function
|
||||
---@field SetColor function
|
||||
---@field GetColor function
|
||||
---@field __iscolorpicker boolean
|
||||
---@field color_texture texture
|
||||
---@field background_texture texture
|
||||
|
||||
---create a button which opens a color picker when clicked
|
||||
---@param parent table
|
||||
---@param name string|nil
|
||||
@@ -1077,33 +1109,38 @@ end
|
||||
end
|
||||
|
||||
function detailsFramework:NewColorPickButton(parent, name, member, callback, alpha, buttonTemplate)
|
||||
--button
|
||||
local colorPickButton = detailsFramework:NewButton(parent, _, name, member, 16, 16, pickcolor, alpha, "param2", nil, nil, nil, buttonTemplate)
|
||||
local colorPickButton = detailsFramework:NewButton(parent, _, name, member, 16, 16, pickcolor, alpha, "param2")
|
||||
---@cast colorPickButton df_colorpickbutton
|
||||
|
||||
colorPickButton.color_callback = callback
|
||||
colorPickButton.Cancel = colorpickCancel
|
||||
colorPickButton.SetColor = setColorPickColor
|
||||
colorPickButton.GetColor = getColorPickColor
|
||||
colorPickButton.__iscolorpicker = true
|
||||
|
||||
colorPickButton.HookList.OnColorChanged = {}
|
||||
|
||||
if (not buttonTemplate) then
|
||||
colorPickButton:SetTemplate(detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
|
||||
end
|
||||
|
||||
--background showing a grid to indicate the transparency
|
||||
local background = colorPickButton:CreateTexture(nil, "background", nil, 2)
|
||||
local background = colorPickButton:CreateTexture("$parentBackgroupTransparency", "background", nil, 2)
|
||||
background:SetPoint("topleft", colorPickButton.widget, "topleft", 0, 0)
|
||||
background:SetPoint("bottomright", colorPickButton.widget, "bottomright", 0, 0)
|
||||
background:SetTexture([[Interface\ITEMSOCKETINGFRAME\UI-EMPTYSOCKET]])
|
||||
background:SetTexCoord(3/16, 13/16, 3/16, 13/16)
|
||||
background:SetAtlas("AnimCreate_Icon_Texture")
|
||||
background:SetAlpha(0.3)
|
||||
colorPickButton.background_texture = background
|
||||
|
||||
--texture which shows the texture color
|
||||
local colorTexture = detailsFramework:NewImage(colorPickButton, nil, 16, 16, nil, nil, "color_texture", "$parentTex")
|
||||
local colorTexture = colorPickButton:CreateTexture("$parentTex", "overlay")
|
||||
colorTexture:SetColorTexture(1, 1, 1)
|
||||
colorTexture:SetPoint("topleft", colorPickButton.widget, "topleft", 0, 0)
|
||||
colorTexture:SetPoint("bottomright", colorPickButton.widget, "bottomright", 0, 0)
|
||||
colorTexture:SetDrawLayer("background", 3)
|
||||
colorPickButton.color_texture = colorTexture
|
||||
|
||||
if (not buttonTemplate) then
|
||||
colorPickButton:SetTemplate(detailsFramework:GetTemplate("button", "OPTIONS_BUTTON_TEMPLATE"))
|
||||
else
|
||||
colorPickButton:SetTemplate(buttonTemplate)
|
||||
end
|
||||
|
||||
return colorPickButton
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user