Commit 1d12afe8 authored by Simpy's avatar Simpy 🐹
Browse files

testing class bar more

parent 3ccd7be1
......@@ -47,7 +47,7 @@ function UF:Configure_ClassBar(frame)
--We don't want to modify the original frame.CLASSBAR_WIDTH value, as it bugs out when the classbar gains more buttons
local CLASSBAR_WIDTH = frame.CLASSBAR_WIDTH
local BAR_SPACING = (UF.BORDER + UF.SPACING) * 2
local SIDE_SPACING = (UF.BORDER + UF.SPACING) * 2
local color = E.db.unitframe.colors.borderColor
if not bars.backdrop.forcedBorderColors then
......@@ -64,7 +64,8 @@ function UF:Configure_ClassBar(frame)
CLASSBAR_WIDTH = db.classbar.detachedWidth
end
bars:SetSize(CLASSBAR_WIDTH - BAR_SPACING, frame.CLASSBAR_HEIGHT - BAR_SPACING)
local SCALED_SPACING = E:Scale(SIDE_SPACING)
bars:SetSize(CLASSBAR_WIDTH - SCALED_SPACING, frame.CLASSBAR_HEIGHT)
if frame.ClassBar == 'ClassPower' or frame.ClassBar == 'Runes' then
if E.myclass == 'DEATHKNIGHT' and frame.ClassBar == 'Runes' then
......@@ -80,17 +81,17 @@ function UF:Configure_ClassBar(frame)
bars[i].backdrop:SetBackdropBorderColor(color.r, color.g, color.b)
end
bars[i]:Height(bars:GetHeight())
bars[i]:SetHeight(bars:GetHeight())
if frame.MAX_CLASS_BAR == 1 then
bars[i]:Width(CLASSBAR_WIDTH)
bars[i]:SetWidth(CLASSBAR_WIDTH)
elseif frame.USE_MINI_CLASSBAR then
if frame.CLASSBAR_DETACHED and db.classbar.orientation == 'VERTICAL' then
bars[i]:Width(CLASSBAR_WIDTH)
bars[i]:SetWidth(CLASSBAR_WIDTH)
else
bars[i]:Width((CLASSBAR_WIDTH - ((5+BAR_SPACING)*(frame.MAX_CLASS_BAR - 1)))/frame.MAX_CLASS_BAR) --Width accounts for 5px spacing between each button, excluding borders
bars[i]:SetWidth((CLASSBAR_WIDTH - ((5+SCALED_SPACING)*(frame.MAX_CLASS_BAR - 1)))/frame.MAX_CLASS_BAR) --Width accounts for 5px spacing between each button, excluding borders
end
elseif i ~= frame.MAX_CLASS_BAR then
bars[i]:Width((CLASSBAR_WIDTH - ((frame.MAX_CLASS_BAR-1)*(UF.BORDER*2-UF.SPACING))) / frame.MAX_CLASS_BAR) --classbar width minus total width of dividers between each button, divided by number of buttons
bars[i]:SetWidth((CLASSBAR_WIDTH - ((frame.MAX_CLASS_BAR-1)*(UF.BORDER*2-UF.SPACING))) / frame.MAX_CLASS_BAR) --classbar width minus total width of dividers between each button, divided by number of buttons
end
bars[i]:GetStatusBarTexture():SetHorizTile(false)
......@@ -101,9 +102,9 @@ function UF:Configure_ClassBar(frame)
else
if frame.USE_MINI_CLASSBAR then
if frame.CLASSBAR_DETACHED and db.classbar.orientation == 'VERTICAL' then
bars[i]:Point('BOTTOM', bars[i-1], 'TOP', 0, (db.classbar.spacing + BAR_SPACING))
bars[i]:Point('BOTTOM', bars[i-1], 'TOP', 0, (db.classbar.spacing + SIDE_SPACING))
else
bars[i]:Point('LEFT', bars[i-1], 'RIGHT', (db.classbar.spacing + BAR_SPACING), 0) --5px spacing between borders of each button(replaced with Detached Spacing option)
bars[i]:Point('LEFT', bars[i-1], 'RIGHT', (db.classbar.spacing + SIDE_SPACING), 0) --5px spacing between borders of each button(replaced with Detached Spacing option)
end
elseif i == frame.MAX_CLASS_BAR then
bars[i]:Point('LEFT', bars[i-1], 'RIGHT', UF.BORDER-UF.SPACING, 0)
......@@ -179,7 +180,7 @@ function UF:Configure_ClassBar(frame)
E:DisableMover(bars.Holder.mover:GetName())
end
elseif frame.CLASSBAR_DETACHED then
bars.Holder:Size(db.classbar.detachedWidth, db.classbar.height)
bars.Holder:SetSize(db.classbar.detachedWidth, db.classbar.height)
bars:ClearAllPoints()
bars:Point('BOTTOMLEFT', bars.Holder, 'BOTTOMLEFT', UF.BORDER + UF.SPACING, UF.BORDER + UF.SPACING)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment