Added Borders to Row's Area and Window Area, renamed the old border to Skin Border

This commit is contained in:
Tercio Jose
2022-05-01 19:23:20 -03:00
parent 08f78be505
commit 08a077b596
4 changed files with 192 additions and 34 deletions
+1 -2
View File
@@ -2410,7 +2410,6 @@ function Details:AutoAlignInLineFontStrings()
local maxStringLength_StringThree = 0
local profileOffsetString3 = self.fontstrings_text3_anchor
local profileOffsetString2 = self.fontstrings_text2_anchor
local offsetTotal = 0
Details.CacheInLineMaxDistance = Details.CacheInLineMaxDistance or {}
Details.CacheInLineMaxDistance[self:GetId()] = Details.CacheInLineMaxDistance[self:GetId()] or {[2] = profileOffsetString2, [3] = profileOffsetString3}
@@ -2489,7 +2488,7 @@ function Details:AutoAlignInLineFontStrings()
local totalWidth = text2:GetStringWidth() + text3:GetStringWidth() + text4:GetStringWidth()
totalWidth = totalWidth + 50
DetailsFramework:TruncateText(playerName, self.cached_bar_width - totalWidth)
DetailsFramework:TruncateText(playerName, self.cached_bar_width - totalWidth) --this avoid truncated strings with ...
--playerName:SetWidth(self.cached_bar_width - totalWidth)
end
end
+15
View File
@@ -192,6 +192,21 @@ _detalhes.instance_defaults = {
fontstrings_text3_anchor = 38,
fontstrings_text2_anchor = 73,
--title bar
titlebar_height = 16,
titlebar_texture = "",
titlebar_color = {0, 0, 0, 0},
--full border
fullborder_shown = false,
fullborder_color = {0, 0, 0, 1},
fullborder_size = 0.5,
--row area border
rowareaborder_shown = false,
rowareaborder_color = {0, 0, 0, 1},
rowareaborder_size = 0.5,
--row info
row_info = {
--if true the texture of the bars will have the color of his actor class
+59
View File
@@ -7228,6 +7228,9 @@ function Details:ChangeSkin(skin_name)
--> refresh lock buttons
self:RefreshLockedState()
self:UpdateFullBorder()
self:UpdateRowAreaBorder()
--> clear any control sscript running in this instance
self.bgframe:SetScript ("OnUpdate", nil)
@@ -7655,6 +7658,62 @@ function _detalhes:SetFrameStrata (strata)
self:StretchButtonAlwaysOnTop()
end
--set and refresh the full border
function Details:UpdateFullBorder(shown, color, size)
if (type(shown) == "boolean") then
self.fullborder_shown = shown
else
shown = self.fullborder_shown
end
if (size) then
self.fullborder_size = size
else
size = self.fullborder_size
end
if (color) then
self.fullborder_color = color
else
color = self.fullborder_color
end
self.baseframe.fullWindowFrame.border:SetShown(shown)
if (shown) then
self.baseframe.fullWindowFrame.border:SetBorderSizes(size, size, size, size)
self.baseframe.fullWindowFrame.border:UpdateSizes()
self.baseframe.fullWindowFrame.border:SetVertexColor(DetailsFramework:ParseColors(color))
end
end
--set and refresh the border of the row area
function Details:UpdateRowAreaBorder(shown, color, size)
if (type(shown) == "boolean") then
self.rowareaborder_shown = shown
else
shown = self.rowareaborder_shown
end
if (size) then
self.rowareaborder_size = size
else
size = self.rowareaborder_size
end
if (color) then
self.rowareaborder_color = color
else
color = self.rowareaborder_color
end
self.baseframe.border:SetShown(shown)
if (shown) then
self.baseframe.border:SetBorderSizes(size, size, size, size)
self.baseframe.border:UpdateSizes()
self.baseframe.border:SetVertexColor(DetailsFramework:ParseColors(color))
end
end
-- ~attributemenu (text with attribute name)
function _detalhes:RefreshAttributeTextSize()
if (self.attribute_text.enabled and self.total_buttons_shown and self.baseframe and self.menu_attribute_string) then
+117 -32
View File
@@ -2596,8 +2596,9 @@ do
local buildSection = function(sectionFrame)
local sectionOptions = {
{type = "label", get = function() return Loc["STRING_OPTIONS_GENERAL_ANCHOR"] end, text_template = subSectionTitleTextTemplate},
{--window color
{--window color (skin color)
type = "color",
get = function()
local r, g, b = unpack (currentInstance.color)
@@ -2608,37 +2609,8 @@ do
editInstanceSetting(currentInstance, "InstanceColor", r, g, b, a, nil, true)
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_INSTANCE_COLOR"],
desc = Loc ["STRING_OPTIONS_INSTANCE_COLOR_DESC"],
},
{--background color
type = "color",
get = function()
return {currentInstance.bg_r, currentInstance.bg_g, currentInstance.bg_b, currentInstance.bg_alpha}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "SetBackgroundColor", r, g, b)
editInstanceSetting(currentInstance, "SetBackgroundAlpha", a)
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_INSTANCE_ALPHA2"],
desc = Loc ["STRING_OPTIONS_INSTANCE_ALPHA2_DESC"],
},
{--window scale
type = "range",
get = function() return tonumber(currentInstance.window_scale) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetWindowScale", value, true)
afterUpdate()
end,
min = 0.65,
max = 1.5,
step = 0.02,
usedecimals = true,
name = Loc ["STRING_OPTIONS_WINDOW_SCALE"],
desc = Loc ["STRING_OPTIONS_WINDOW_SCALE_DESC"],
name = Loc ["STRING_OPTIONS_WINDOW_SKIN_COLOR"],
desc = Loc ["STRING_OPTIONS_WINDOW_SKIN_COLOR_DESC"],
},
{--show borders
@@ -2657,6 +2629,35 @@ do
desc = Loc ["STRING_OPTIONS_SHOW_SIDEBARS_DESC"],
},
{--background color
type = "color",
get = function()
return {currentInstance.bg_r, currentInstance.bg_g, currentInstance.bg_b, currentInstance.bg_alpha}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "SetBackgroundColor", r, g, b)
editInstanceSetting(currentInstance, "SetBackgroundAlpha", a)
afterUpdate()
end,
name = Loc ["STRING_OPTIONS_WINDOW_ROWAREA_COLOR"],
desc = Loc ["STRING_OPTIONS_WINDOW_ROWAREA_COLOR_DESC"],
},
{--window scale
type = "range",
get = function() return tonumber(currentInstance.window_scale) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "SetWindowScale", value, true)
afterUpdate()
end,
min = 0.65,
max = 1.5,
step = 0.02,
usedecimals = true,
name = Loc ["STRING_OPTIONS_WINDOW_SCALE"],
desc = Loc ["STRING_OPTIONS_WINDOW_SCALE_DESC"],
},
{--ignore on mass hide
type = "toggle",
get = function() return currentInstance.ignore_mass_showhide end,
@@ -2785,6 +2786,90 @@ do
--icontexture = [[Interface\Buttons\UI-GuildButton-MOTD-Up]],
--icontexcoords = {1, 0, 0, 1},
},
{type = "breakline"},
{type = "label", get = function() return "Window Area Border" end, text_template = subSectionTitleTextTemplate},
{--show full border ~border
type = "toggle",
get = function() return currentInstance.fullborder_shown end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "UpdateFullBorder", value)
afterUpdate()
end,
name = "Show Border",
desc = "Show Border",
},
{--full border color
type = "color",
get = function()
return {unpack(currentInstance.fullborder_color)}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "UpdateFullBorder", nil, {r, g, b, a})
afterUpdate()
end,
name = "Border Color",
desc = "Border Color",
},
{--border size
type = "range",
get = function() return tonumber(currentInstance.fullborder_size) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "UpdateFullBorder", nil, nil, value)
afterUpdate()
end,
min = 0,
max = 5,
step = 0.5,
usedecimals = true,
name = "Border Thickness",
desc = "Border Thickness",
},
{type = "blank"},
{type = "label", get = function() return "Row's Area Border" end, text_template = subSectionTitleTextTemplate},
{--show full border ~border
type = "toggle",
get = function() return currentInstance.rowareaborder_shown end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "UpdateRowAreaBorder", value)
afterUpdate()
end,
name = "Show Border",
desc = "Show Border",
},
{--full border color
type = "color",
get = function()
return {unpack(currentInstance.rowareaborder_color)}
end,
set = function (self, r, g, b, a)
editInstanceSetting(currentInstance, "UpdateRowAreaBorder", nil, {r, g, b, a})
afterUpdate()
end,
name = "Border Color",
desc = "Border Color",
},
{--border size
type = "range",
get = function() return tonumber(currentInstance.rowareaborder_size) end,
set = function (self, fixedparam, value)
editInstanceSetting(currentInstance, "UpdateRowAreaBorder", nil, nil, value)
afterUpdate()
end,
min = 0,
max = 5,
step = 0.5,
usedecimals = true,
name = "Border Thickness",
desc = "Border Thickness",
},
}
sectionFrame.sectionOptions = sectionOptions