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:
+71
-8
@@ -885,13 +885,26 @@ local get_switch_func = function(self)
|
||||
return self.OnSwitch
|
||||
end
|
||||
|
||||
local setCheckedTexture = function(self, texture, xOffSet, yOffSet)
|
||||
self.checked_texture:SetTexture(texture)
|
||||
local setCheckedTexture = function(self, texture, xOffSet, yOffSet, sizePercent, color)
|
||||
if (texture) then
|
||||
self.checked_texture:SetTexture(texture, "CLAMP", "CLAMP", "TRILINEAR")
|
||||
end
|
||||
|
||||
if (xOffSet or yOffSet) then
|
||||
self.checked_texture:SetPoint("center", self.button, "center", xOffSet or -1, yOffSet or -1)
|
||||
else
|
||||
self.checked_texture:SetPoint("center", self.button, "center", -1, -1)
|
||||
end
|
||||
|
||||
if (sizePercent and type(sizePercent) == "number") then
|
||||
local width = self:GetWidth() * sizePercent
|
||||
self.checked_texture:SetSize(width, width)
|
||||
end
|
||||
|
||||
if (color) then
|
||||
local r, g, b, a = DF:ParseColors(color)
|
||||
self.checked_texture:SetVertexColor(r, g, b, a)
|
||||
end
|
||||
end
|
||||
|
||||
local set_as_checkbok = function(self)
|
||||
@@ -904,6 +917,7 @@ local set_as_checkbok = function(self)
|
||||
self.checked_texture = checked
|
||||
|
||||
self.SetCheckedTexture = setCheckedTexture
|
||||
self.SetChecked = switch_set_value
|
||||
|
||||
self._thumb:Hide()
|
||||
self._text:Hide()
|
||||
@@ -1041,6 +1055,14 @@ function DF:NewSwitch(parent, container, name, member, width, height, leftText,
|
||||
end
|
||||
|
||||
function DFSliderMetaFunctions:SetTemplate(template)
|
||||
if (type(template) == "string") then
|
||||
local templateName = template
|
||||
template = DF:GetTemplate("switch", templateName)
|
||||
if (not template) then
|
||||
print("no template found", templateName)
|
||||
end
|
||||
end
|
||||
|
||||
--slider e switch
|
||||
if (template.width) then
|
||||
PixelUtil.SetWidth(self.widget, template.width)
|
||||
@@ -1103,13 +1125,54 @@ function DFSliderMetaFunctions:SetTemplate(template)
|
||||
local r, g, b, a = DF:ParseColors(template.disabled_backdropcolor)
|
||||
self.backdrop_disabledcolor = {r, g, b, a}
|
||||
end
|
||||
|
||||
if (template.is_checkbox) then
|
||||
self:SetAsCheckBox()
|
||||
self:SetCheckedTexture(template.checked_texture, template.checked_xoffset or 0, template.checked_yoffset or 0, template.checked_size_percent or 0.7, template.checked_color)
|
||||
end
|
||||
|
||||
if (template.rounded_corner) then
|
||||
self:SetBackdrop(nil)
|
||||
DF:AddRoundedCornersToFrame(self.widget or self, template.rounded_corner)
|
||||
end
|
||||
end
|
||||
|
||||
function DF:CreateSlider (parent, w, h, min, max, step, defaultv, isDecemal, member, name, with_label, slider_template, label_template)
|
||||
local slider, label = DF:NewSlider (parent, parent, name, member, w, h, min, max, step, defaultv, isDecemal, false, with_label, slider_template, label_template)
|
||||
return slider, label
|
||||
--DF:Mixin(DFSliderMetaFunctions, DF.SetPointMixin)
|
||||
--DF:Mixin(DFSliderMetaFunctions, DF.FrameMixin)
|
||||
--DF:Mixin(DFSliderMetaFunctions, DF.TooltipHandlerMixin)
|
||||
|
||||
---@class df_slider : slider, df_scripthookmixin
|
||||
---@field widget slider
|
||||
---@field slider slider
|
||||
---@field type string
|
||||
---@field dframework boolean
|
||||
---@field SetTemplate fun(self:df_slider, template: table|string)
|
||||
---@field SetFixedParameter fun(value: any)
|
||||
---@field GetFixedParameter fun()
|
||||
---@field SetValueNoCallback fun(value: number)
|
||||
---@field SetThumbSize fun(width:number, height:number)
|
||||
---@field ClearFocus fun()
|
||||
|
||||
---@param parent frame
|
||||
---@param width number? default 150
|
||||
---@param height number? default 20
|
||||
---@param minValue number? default 1
|
||||
---@param maxValue number? default 2
|
||||
---@param step number? default 1
|
||||
---@param defaultv number? default to minValue
|
||||
---@param isDecemal boolean? default false
|
||||
---@param member string?
|
||||
---@param name string?
|
||||
---@param label string?
|
||||
---@param sliderTemplate string|table|nil
|
||||
---@param labelTemplate string|table|nil
|
||||
---@return df_slider, df_label?
|
||||
function DF:CreateSlider (parent, width, height, minValue, maxValue, step, defaultv, isDecemal, member, name, label, sliderTemplate, labelTemplate)
|
||||
local slider, labelText = DF:NewSlider(parent, parent, name, member, width, height, minValue, maxValue, step, defaultv, isDecemal, false, label, sliderTemplate, labelTemplate)
|
||||
return slider, labelText
|
||||
end
|
||||
|
||||
---@return df_slider, df_label?
|
||||
function DF:NewSlider (parent, container, name, member, width, height, minValue, maxValue, step, defaultValue, isDecemal, isSwitch, with_label, slider_template, label_template)
|
||||
if (not name) then
|
||||
name = "DetailsFrameworkSlider" .. DF.SliderCounter
|
||||
@@ -1117,7 +1180,7 @@ function DF:NewSlider (parent, container, name, member, width, height, minValue,
|
||||
end
|
||||
|
||||
if (not parent) then
|
||||
return error("Details! FrameWork: parent not found.", 2)
|
||||
error("Details! FrameWork: parent not found.", 2)
|
||||
end
|
||||
|
||||
if (not container) then
|
||||
@@ -1148,8 +1211,8 @@ function DF:NewSlider (parent, container, name, member, width, height, minValue,
|
||||
step = step or 1
|
||||
defaultValue = defaultValue or minValue
|
||||
|
||||
width = width or 130
|
||||
height = height or 19
|
||||
width = width or 160
|
||||
height = height or 20
|
||||
|
||||
--default members
|
||||
SliderObject.lockdown = false
|
||||
|
||||
Reference in New Issue
Block a user