diff --git a/Frame.lua b/Frame.lua index b32e392..3092ce9 100644 --- a/Frame.lua +++ b/Frame.lua @@ -32,6 +32,12 @@ Gladdy.BUTTON_DEFAULTS = { function Gladdy:CreateFrame() self.frame = CreateFrame("Frame", "GladdyFrame", UIParent) + + self.frame.background = CreateFrame("Frame", nil, self.frame, BackdropTemplateMixin and "BackdropTemplate") + self.frame.background:SetBackdrop({bgFile = "Interface\\Tooltips\\UI-Tooltip-Background", tile = false, tileSize = 16}) + self.frame.background:SetFrameStrata("BACKGROUND") + self.frame.background:SetBackdropColor(self.db.backgroundColor.r, self.db.backgroundColor.g, self.db.backgroundColor.b, self.db.backgroundColor.a) + self.frame.background:SetAllPoints(self.frame) --self.frame.texture = self.frame:CreateTexture(nil, "OVERLAY") --self.frame.texture:SetAllPoints(self.frame) --self.frame.texture:SetTexture("Interface\\AddOns\\Gladdy\\Images\\Border_rounded_blp") @@ -186,6 +192,8 @@ function Gladdy:UpdateFrame() self.frame:SetScale(self.db.frameScale) self.frame:SetWidth(width) self.frame:SetHeight(height) + self.frame:ClearAllPoints() + self.frame.background:SetBackdropColor(self.db.backgroundColor.r, self.db.backgroundColor.g, self.db.backgroundColor.b, self.db.backgroundColor.a) --self.frame:SetBackdropColor(self.db.frameColor.r, self.db.frameColor.g, self.db.frameColor.b, self.db.frameColor.a) self.frame:ClearAllPoints() if (self.db.x == 0 and self.db.y == 0) then diff --git a/Options.lua b/Options.lua index e62a053..8fd249c 100644 --- a/Options.lua +++ b/Options.lua @@ -53,7 +53,8 @@ Gladdy.defaults = { barWidth = 180, bottomMargin = 2, statusbarBorderOffset = 6, - timerFormat = Gladdy.TIMER_FORMAT.tenths + timerFormat = Gladdy.TIMER_FORMAT.tenths, + backgroundColor = {r = 0, g = 0, b = 0, a = 0}, }, } @@ -225,12 +226,6 @@ function Gladdy:SetupOptions() desc = L["Toggle if frame can be moved"], order = 1, }, - growUp = { - type = "toggle", - name = L["Grow frame upwards"], - desc = L["If enabled the frame will grow upwards instead of downwards"], - order = 2, - }, growDirection = { type = "select", name = L["Grow Direction"], @@ -304,6 +299,15 @@ function Gladdy:SetupOptions() max = 200, step = 1, }, + backgroundColor = { + type = "color", + name = L["Background color"], + desc = L["Background Color of the frame"], + order = 8, + hasAlpha = true, + get = getColorOpt, + set = setColorOpt, + }, } }, cooldownGeneral = {