Skip to content

Commit

Permalink
Adjustible selection border width
Browse files Browse the repository at this point in the history
  • Loading branch information
d87 committed May 8, 2022
1 parent 4a52ce9 commit c3a9714
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Aptechka.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
26 changes: 26 additions & 0 deletions Options/ProfileSettings.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
Binary file modified border.tga
Binary file not shown.
14 changes: 12 additions & 2 deletions frame.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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, ...)

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit c3a9714

Please sign in to comment.