|
|
|
@ -39,22 +39,6 @@ local Stylesheet = { |
|
|
|
|
color = "ffffff", |
|
|
|
|
alpha = 0.1, |
|
|
|
|
}, |
|
|
|
|
["button-leftExpandIcon"] = { |
|
|
|
|
type = "texture", |
|
|
|
|
position = { 0, nil, -1, nil }, |
|
|
|
|
height = 16, |
|
|
|
|
width = 16, |
|
|
|
|
image = { "DiesalGUIcons", { 3, 6, 16, 256, 128 }, HSL(Colors.UI_Hue, Colors.UI_Saturation, 0.65) }, |
|
|
|
|
alpha = 1, |
|
|
|
|
}, |
|
|
|
|
["button-leftCollapseIcon"] = { |
|
|
|
|
type = "texture", |
|
|
|
|
position = { 0, nil, -1, nil }, |
|
|
|
|
height = 16, |
|
|
|
|
width = 16, |
|
|
|
|
image = { "DiesalGUIcons", { 4, 6, 16, 256, 128 }, HSL(Colors.UI_Hue, Colors.UI_Saturation, 0.65) }, |
|
|
|
|
alpha = 1, |
|
|
|
|
}, |
|
|
|
|
["content-background"] = { |
|
|
|
|
type = "texture", |
|
|
|
|
layer = "BACKGROUND", |
|
|
|
@ -134,10 +118,6 @@ local methods = { |
|
|
|
|
if self.settings.position == 1 then |
|
|
|
|
self:SetPoint("TOPLEFT", subsectionXOffset, subsectionYOffset) |
|
|
|
|
self:SetPoint("RIGHT", -subsectionXOffset, 0) |
|
|
|
|
elseif self.settings.subsection then |
|
|
|
|
local anchor = self.settings.parentObject.content |
|
|
|
|
self:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", subsectionXOffset, subsectionYOffset) |
|
|
|
|
self:SetPoint("RIGHT", -subsectionXOffset, 0) |
|
|
|
|
else |
|
|
|
|
local anchor = self.settings.parentObject.children[self.settings.position - 1].frame |
|
|
|
|
self:SetPoint("TOPLEFT", anchor, "BOTTOMLEFT", subsectionXOffset, subsectionYOffset) |
|
|
|
@ -159,12 +139,14 @@ local methods = { |
|
|
|
|
end |
|
|
|
|
self.settings.expanded = false |
|
|
|
|
self:FireEvent("OnStateChange", self.settings.position, "Collapse") |
|
|
|
|
self.textures["button-leftCollapseIcon"]:SetAlpha(self.textures["button-leftCollapseIcon"].style.alpha[1]) |
|
|
|
|
self.textures["button-leftExpandIcon"]:SetAlpha(0) |
|
|
|
|
--self.icon:SetTexCoord(0, 0.4375, 0, 0.4375) |
|
|
|
|
--self.icon:SetAtlas("campaign_headericon_closed", false) |
|
|
|
|
--self.textures["button-leftCollapseIcon"]:SetAlpha(self.textures["button-leftCollapseIcon"].style.alpha[1]) |
|
|
|
|
--self.textures["button-leftExpandIcon"]:SetAlpha(0) |
|
|
|
|
self.icon:SetAtlas("uitools-icon-plus") |
|
|
|
|
self.content:Hide() |
|
|
|
|
self:UpdateHeight() |
|
|
|
|
if self.settings.subsection and self.settings.parentObject then |
|
|
|
|
self.settings.parentObject:ApplySettings() |
|
|
|
|
if self.settings.subsection and self.settings.parentObject and self.settings.parentObject.UpdateHeight then |
|
|
|
|
self.settings.parentObject:UpdateHeight() |
|
|
|
|
end |
|
|
|
|
end, |
|
|
|
@ -173,12 +155,14 @@ local methods = { |
|
|
|
|
Expand = function(self) |
|
|
|
|
self.settings.expanded = true |
|
|
|
|
self:FireEvent("OnStateChange", self.settings.position, "Expand") |
|
|
|
|
self.textures["button-leftExpandIcon"]:SetAlpha(self.textures["button-leftExpandIcon"].style.alpha[1]) |
|
|
|
|
self.textures["button-leftCollapseIcon"]:SetAlpha(0) |
|
|
|
|
--self.icon:SetAtlas("campaign_headericon_open", false) |
|
|
|
|
--self.icon:SetTexCoord(0.5625, 1, 0, 0.4375) |
|
|
|
|
--self.textures["button-leftExpandIcon"]:SetAlpha(self.textures["button-leftExpandIcon"].style.alpha[1]) |
|
|
|
|
--self.textures["button-leftCollapseIcon"]:SetAlpha(0) |
|
|
|
|
self.icon:SetAtlas("uitools-icon-minus") |
|
|
|
|
self.content:Show() |
|
|
|
|
self:UpdateHeight() |
|
|
|
|
if self.settings.subsection and self.settings.parentObject then |
|
|
|
|
self.settings.parentObject:ApplySettings() |
|
|
|
|
if self.settings.subsection and self.settings.parentObject and self.settings.parentObject.UpdateHeight then |
|
|
|
|
self.settings.parentObject:UpdateHeight() |
|
|
|
|
end |
|
|
|
|
end, |
|
|
|
@ -239,7 +223,7 @@ local function Constructor() |
|
|
|
|
|
|
|
|
|
self.isContainer = true |
|
|
|
|
|
|
|
|
|
local frame = CreateFrame("Frame", nil, UIParent) |
|
|
|
|
local frame = CreateFrame("Frame", nil, DiesalGUI.UIParent) |
|
|
|
|
self.frame = frame |
|
|
|
|
|
|
|
|
|
self.defaults = { |
|
|
|
@ -259,8 +243,18 @@ local function Constructor() |
|
|
|
|
self[self.settings.expanded and "Collapse" or "Expand"](self) |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
-- 877-222-8387 |
|
|
|
|
|
|
|
|
|
local buttonIcon = self:CreateRegion("Texture", "icon", button) |
|
|
|
|
buttonIcon:SetVertexColor(1, 1, 0) |
|
|
|
|
buttonIcon:SetAtlas("uitools-icon-plus") |
|
|
|
|
--buttonIcon:SetTexture("Interface\\Buttons\\UI-PlusMinus-Buttons") |
|
|
|
|
--buttonIcon:SetTexCoord(0, 0.4375, 0, 0.4375) |
|
|
|
|
buttonIcon:SetPoint("TOPLEFT", 1, -3) |
|
|
|
|
buttonIcon:SetSize(10,10) |
|
|
|
|
|
|
|
|
|
local text = self:CreateRegion("FontString", "text", button) |
|
|
|
|
text:SetPoint("TOPLEFT", 15, -2) |
|
|
|
|
text:SetPoint("TOPLEFT", 15, -1) |
|
|
|
|
text:SetPoint("BOTTOMRIGHT", -15, 0) |
|
|
|
|
text:SetHeight(0) |
|
|
|
|
text:SetJustifyH("MIDDLE") |
|
|
|
@ -271,12 +265,7 @@ local function Constructor() |
|
|
|
|
content:SetPoint("TOPLEFT", frame, 0, 0) |
|
|
|
|
content:SetPoint("TOPRIGHT", frame, 0, 0) |
|
|
|
|
content:SetHeight(10) |
|
|
|
|
-- ~~ Methods ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
|
|
self:SetMethods(methods) |
|
|
|
|
--[[ for method, func in pairs(methods) do |
|
|
|
|
self[method] = func |
|
|
|
|
end ]] |
|
|
|
|
-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
|
|
|
|
return self |
|
|
|
|
end |
|
|
|
|
DiesalGUI:RegisterObjectConstructor(Type, Constructor, Version) |
|
|
|
|