From c3a97142c92eacd99ada5541d5dd03f408f812cf Mon Sep 17 00:00:00 2001 From: d87 Date: Sun, 8 May 2022 14:41:16 +0700 Subject: [PATCH] Adjustible selection border width --- Aptechka.lua | 2 ++ Options/ProfileSettings.lua | 26 ++++++++++++++++++++++++++ border.tga | Bin 8236 -> 8236 bytes frame.lua | 14 ++++++++++++-- 4 files changed, 40 insertions(+), 2 deletions(-) diff --git a/Aptechka.lua b/Aptechka.lua index 0b60d52..c104b9a 100644 --- a/Aptechka.lua +++ b/Aptechka.lua @@ -269,6 +269,8 @@ local defaults = { customBackgroundColorPower = {0.5, 0.5, 1}, petColor = {1, 0.5, 0.5}, alphaOutOfRange = 0.45, + selBorderWidth = 2, + selBorderInset = 0, scale = 1, --> into debuffBossScale = 1.3, diff --git a/Options/ProfileSettings.lua b/Options/ProfileSettings.lua index 4626908..25660ee 100644 --- a/Options/ProfileSettings.lua +++ b/Options/ProfileSettings.lua @@ -606,6 +606,32 @@ function ns.MakeProfileSettings() end, order = 14.7, }, + selBorderWidth = { + name = L"Sel.Border Width", + type = "range", + get = function(info) return Aptechka.db.profile.selBorderWidth end, + set = function(info, v) + Aptechka.db.profile.selBorderWidth = v + Aptechka:ReconfigureUnprotected() + end, + min = 1, + max = 10, + step = 0.1, + order = 14.71, + }, + selBorderInset = { + name = L"Sel.Border Inset", + type = "range", + get = function(info) return Aptechka.db.profile.selBorderInset end, + set = function(info, v) + Aptechka.db.profile.selBorderInset = v + Aptechka:ReconfigureUnprotected() + end, + min = 0, + max = 7, + step = 0.1, + order = 14.72, + }, healthColorGroup = { diff --git a/border.tga b/border.tga index 39f8849bc077b0181214ffbc2acc2f14ee2e3c12..977369f69ae271f918f3c25d6227b6bade605b88 100644 GIT binary patch literal 8236 zcmeH_I|>3Z7=(kBrAP1rdW#hnM8Ovx$D7CMD^m=7pg&}rfz7-!yRB^+&!_F$e%l8R zEDHxQ!`D_WKEt5F0Xho@F@O8ox;H-QMbTMUEkEsR^R3u`PT0Er2WuYSS>&8YxAw$@k#rkv#?rz+Sle=yW=zJ V$NA&-Twd#ayS>f`e-e*?_7$MkIXcD)>4r*@u>@ddya2@n7P diff --git a/frame.lua b/frame.lua index bf6fd21..923c5be 100644 --- a/frame.lua +++ b/frame.lua @@ -2796,9 +2796,16 @@ end local border_backdrop = { - edgeFile = "Interface\\Addons\\Aptechka\\border", tileEdge = true, edgeSize = 14, - insets = {left = -2, right = -2, top = -2, bottom = -2}, + edgeFile = "Interface\\Addons\\Aptechka\\border", tileEdge = true, edgeSize = 7, } +local function Border_SetSize(parent, border, borderWidth, outboundRange) + border.backdropInfo.edgeSize = 3.5 * borderWidth + local outlineSize = pixelperfect(Aptechka.db.global.borderWidth) + local p4 = outlineSize + pixelperfect(2) + outboundRange + border:SetPoint("TOPLEFT", parent, "TOPLEFT", -p4, p4) + border:SetPoint("BOTTOMRIGHT", parent, "BOTTOMRIGHT", p4, -p4) + border:ApplyBackdrop() +end local Border_SetJob = function(self, job, state, contentType, ...) local timerType, cur, max, count, icon, text, r,g,b, texture, texCoords = NormalizeContent(job, state, contentType, ...) @@ -2923,6 +2930,8 @@ local function Reconf(self) if self.power.separator then self.power.separator:Hide() end end + Border_SetSize(self, self.border, db.selBorderWidth, db.selBorderInset) + if not db.fgShowMissing then -- Blizzard's StatusBar SetFillStyle is bad, because even if it reverses direction, -- it still cuts tex coords from the usual direction @@ -3271,6 +3280,7 @@ AptechkaDefaultConfig.GridSkin = function(self) border:SetPoint("TOPLEFT", self, "TOPLEFT", -p4, p4) border:SetPoint("BOTTOMRIGHT", self, "BOTTOMRIGHT", p4, -p4) border:SetBackdrop(border_backdrop) + Border_SetSize(self, border, db.selBorderWidth, db.selBorderInset) border:SetBackdropBorderColor(1, 1, 1, 0.5) -- new composite border