mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-11 08:00:01 +00:00
Added and fixed form layout+ uneven orientation
Stance/Form/Aura bar layout fix (before wrong), plus support for uneven rows.
This commit is contained in:
+25
-4
@@ -1276,6 +1276,26 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
||||
local spacing = C.bars["bar"..i].spacing
|
||||
local background = C.bars["bar"..i].background
|
||||
local formfactor = C.bars["bar"..i].formfactor
|
||||
local uneven = C.bars["bar"..i].uneven
|
||||
local _, _, cols, rows = string.find(tostring(formfactor or ""), "(%d+)%s*x%s*(%d+)")
|
||||
cols, rows = tonumber(cols), tonumber(rows)
|
||||
local is_square = cols == 3 and rows == 3
|
||||
local is_vertical = cols and cols <= 3 and not is_square
|
||||
local is_horizontal = rows and rows <= 3 and not is_square
|
||||
|
||||
if is_vertical then
|
||||
if uneven ~= "Up" and uneven ~= "Down" then
|
||||
uneven = "Up"
|
||||
end
|
||||
elseif is_horizontal then
|
||||
if uneven ~= "Left" and uneven ~= "Right" then
|
||||
uneven = "Left"
|
||||
end
|
||||
elseif not uneven then
|
||||
uneven = "Up"
|
||||
end
|
||||
|
||||
C.bars["bar"..i].uneven = uneven
|
||||
local autohide = C.bars["bar"..i].autohide
|
||||
local hide_time = C.bars["bar"..i].hide_time
|
||||
local hide_combat = C.bars["bar"..i].hide_combat == "1" and true or nil
|
||||
@@ -1298,7 +1318,8 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
||||
end
|
||||
|
||||
-- the stored layout is invalid, temporary fallback
|
||||
if not pfGridmath[buttons][BarLayoutFormfactor(formfactor)] then
|
||||
local _, _, fcols, frows = string.find(tostring(formfactor or ""), "(%d+)%s*x%s*(%d+)")
|
||||
if not ((fcols and frows) or pfGridmath[buttons][BarLayoutFormfactor(formfactor)]) then
|
||||
formfactor = BarLayoutOptions(buttons)[1]
|
||||
end
|
||||
|
||||
@@ -1407,7 +1428,7 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
||||
bars[i][j] = CreateActionButton(bars[i], i, j)
|
||||
bars[i][j].bar = i
|
||||
|
||||
BarButtonAnchor(bars[i][j], buttonbasename, j, buttons, formfactor, size, border, spacing)
|
||||
BarButtonAnchor(bars[i][j], buttonbasename, j, buttons, formfactor, size, border, spacing, uneven)
|
||||
bars[i][j]:ClearAllPoints()
|
||||
bars[i][j]:SetPoint(unpack(bars[i][j]._anchor))
|
||||
bars[i][j]:Show()
|
||||
@@ -1438,7 +1459,7 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
||||
end
|
||||
|
||||
-- adjust actionbar size
|
||||
BarLayoutSize(bars[i], buttons, formfactor, size, border, spacing)
|
||||
BarLayoutSize(bars[i], buttons, formfactor, size, border, spacing, uneven)
|
||||
bars[i]:SetWidth(bars[i]._size[1])
|
||||
bars[i]:SetHeight(bars[i]._size[2])
|
||||
bars[i]:ClearAllPoints()
|
||||
@@ -1752,4 +1773,4 @@ pfUI:RegisterModule("actionbar", "vanilla", function ()
|
||||
return reagent_counts[reagent_slots[slot]]
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user