mirror of
https://github.com/brues-code/pfUI.git
synced 2026-11-02 17:06:57 +00:00
Raid unitframes: add option to reverse group order (#75)
* Add raidreverse default to unitframes config Defaults to off, so existing layouts are unchanged. * Raid frames: add option to reverse group order Read the new raidreverse setting and mirror the column index when placing raid frames, so group 1 sits on the far right and the following groups grow to the left. * Add "Reverse Group Order" checkbox to raid settings Placed under "Raid Fill Direction" in the raid frame options. /pfui > Settings > Unit Frames > Raid > Layout * Raid frames: rename reverse option to "Grow Right To Left" The option mirrors columns in both fill directions, so name it for what it does. Mirror across the columns maxraid can fill instead of the whole layout, so smaller raids stay next to the anchor. Lay the raid grid out through SlotToCoord like the pet grid, move the default next to the other raid layout keys, and add the label to the locale tables. --------- Co-authored-by: Brues <5278969+brues-code@users.noreply.github.com>
This commit is contained in:
@@ -460,6 +460,7 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("unitframes", "raid", "raidlayout", "8x5")
|
pfUI:UpdateConfig("unitframes", "raid", "raidlayout", "8x5")
|
||||||
pfUI:UpdateConfig("unitframes", "raid", "raidpadding", "3")
|
pfUI:UpdateConfig("unitframes", "raid", "raidpadding", "3")
|
||||||
pfUI:UpdateConfig("unitframes", "raid", "raidfill", "VERTICAL")
|
pfUI:UpdateConfig("unitframes", "raid", "raidfill", "VERTICAL")
|
||||||
|
pfUI:UpdateConfig("unitframes", "raid", "raidgrowleft", "0")
|
||||||
pfUI:UpdateConfig("unitframes", "raid", "collapse", "0")
|
pfUI:UpdateConfig("unitframes", "raid", "collapse", "0")
|
||||||
pfUI:UpdateConfig("unitframes", "raid", "raidgrouplabel", "0")
|
pfUI:UpdateConfig("unitframes", "raid", "raidgrouplabel", "0")
|
||||||
pfUI:UpdateConfig("unitframes", "raid", "grouplabelxoff", "0")
|
pfUI:UpdateConfig("unitframes", "raid", "grouplabelxoff", "0")
|
||||||
|
|||||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["deDE"] = {
|
|||||||
["Group Options"] = nil,
|
["Group Options"] = nil,
|
||||||
["Group-Pet"] = nil,
|
["Group-Pet"] = nil,
|
||||||
["Group-Target"] = nil,
|
["Group-Target"] = nil,
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = nil,
|
["Gryphon"] = nil,
|
||||||
["Gryphons"] = nil,
|
["Gryphons"] = nil,
|
||||||
["Guild Online"] = nil,
|
["Guild Online"] = nil,
|
||||||
|
|||||||
Vendored
+1
@@ -373,6 +373,7 @@ pfUI_translation["enUS"] = {
|
|||||||
["Group Options"] = nil,
|
["Group Options"] = nil,
|
||||||
["Group-Pet"] = nil,
|
["Group-Pet"] = nil,
|
||||||
["Group-Target"] = nil,
|
["Group-Target"] = nil,
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = nil,
|
["Gryphon"] = nil,
|
||||||
["Gryphons"] = nil,
|
["Gryphons"] = nil,
|
||||||
["Guild Online"] = nil,
|
["Guild Online"] = nil,
|
||||||
|
|||||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["esES"] = {
|
|||||||
["Group Options"] = "Opciones de grupo",
|
["Group Options"] = "Opciones de grupo",
|
||||||
["Group-Pet"] = "Mascota-Grupo",
|
["Group-Pet"] = "Mascota-Grupo",
|
||||||
["Group-Target"] = "Objetivo-Grupo",
|
["Group-Target"] = "Objetivo-Grupo",
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = nil,
|
["Gryphon"] = nil,
|
||||||
["Gryphons"] = nil,
|
["Gryphons"] = nil,
|
||||||
["Guild Online"] = "Conectados en hermandad",
|
["Guild Online"] = "Conectados en hermandad",
|
||||||
|
|||||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["frFR"] = {
|
|||||||
["Group Options"] = "Options de groupe",
|
["Group Options"] = "Options de groupe",
|
||||||
["Group-Pet"] = "Groupe des familiers",
|
["Group-Pet"] = "Groupe des familiers",
|
||||||
["Group-Target"] = "Groupe des cibles",
|
["Group-Target"] = "Groupe des cibles",
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = nil,
|
["Gryphon"] = nil,
|
||||||
["Gryphons"] = nil,
|
["Gryphons"] = nil,
|
||||||
["Guild Online"] = "Membres de guilde connectés",
|
["Guild Online"] = "Membres de guilde connectés",
|
||||||
|
|||||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["koKR"] = {
|
|||||||
["Group Options"] = nil,
|
["Group Options"] = nil,
|
||||||
["Group-Pet"] = "파티-팻",
|
["Group-Pet"] = "파티-팻",
|
||||||
["Group-Target"] = "파티-타켓",
|
["Group-Target"] = "파티-타켓",
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = nil,
|
["Gryphon"] = nil,
|
||||||
["Gryphons"] = nil,
|
["Gryphons"] = nil,
|
||||||
["Guild Online"] = "접속중인 길드원",
|
["Guild Online"] = "접속중인 길드원",
|
||||||
|
|||||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["ruRU"] = {
|
|||||||
["Group Options"] = "Настройки группы",
|
["Group Options"] = "Настройки группы",
|
||||||
["Group-Pet"] = "Группа-питомец",
|
["Group-Pet"] = "Группа-питомец",
|
||||||
["Group-Target"] = "Группа-цель",
|
["Group-Target"] = "Группа-цель",
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = nil,
|
["Gryphon"] = nil,
|
||||||
["Gryphons"] = nil,
|
["Gryphons"] = nil,
|
||||||
["Guild Online"] = "Члены гильдии в сети",
|
["Guild Online"] = "Члены гильдии в сети",
|
||||||
|
|||||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["zhCN"] = {
|
|||||||
["Group Options"] = "队伍选项",
|
["Group Options"] = "队伍选项",
|
||||||
["Group-Pet"] = "小队宠物",
|
["Group-Pet"] = "小队宠物",
|
||||||
["Group-Target"] = "小队目标",
|
["Group-Target"] = "小队目标",
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = "狮鹫",
|
["Gryphon"] = "狮鹫",
|
||||||
["Gryphons"] = "狮鹫(多个)",
|
["Gryphons"] = "狮鹫(多个)",
|
||||||
["Guild Online"] = "公会在线",
|
["Guild Online"] = "公会在线",
|
||||||
|
|||||||
Vendored
+1
@@ -359,6 +359,7 @@ pfUI_translation["zhTW"] = {
|
|||||||
["Group Options"] = nil,
|
["Group Options"] = nil,
|
||||||
["Group-Pet"] = "小隊寵物",
|
["Group-Pet"] = "小隊寵物",
|
||||||
["Group-Target"] = "小隊目標",
|
["Group-Target"] = "小隊目標",
|
||||||
|
["Grow Right To Left"] = nil,
|
||||||
["Gryphon"] = nil,
|
["Gryphon"] = nil,
|
||||||
["Gryphons"] = nil,
|
["Gryphons"] = nil,
|
||||||
["Guild Online"] = "公會線上",
|
["Guild Online"] = "公會線上",
|
||||||
|
|||||||
@@ -2294,6 +2294,7 @@ pfUI:RegisterModule("gui", function ()
|
|||||||
CreateConfig(U["raid"], T["Raid Padding"], C.unitframes[c], "raidpadding")
|
CreateConfig(U["raid"], T["Raid Padding"], C.unitframes[c], "raidpadding")
|
||||||
CreateConfig(U["raid"], T["Raid Layout"], C.unitframes[c], "raidlayout", "dropdown", pfUI.gui.dropdowns.uf_raidlayout)
|
CreateConfig(U["raid"], T["Raid Layout"], C.unitframes[c], "raidlayout", "dropdown", pfUI.gui.dropdowns.uf_raidlayout)
|
||||||
CreateConfig(U["raid"], T["Raid Fill Direction"], C.unitframes[c], "raidfill", "dropdown", pfUI.gui.dropdowns.orientation)
|
CreateConfig(U["raid"], T["Raid Fill Direction"], C.unitframes[c], "raidfill", "dropdown", pfUI.gui.dropdowns.orientation)
|
||||||
|
CreateConfig(U["raid"], T["Grow Right To Left"], C.unitframes[c], "raidgrowleft", "checkbox")
|
||||||
CreateConfig(U["raid"], T["Collapse Empty Slots"], C.unitframes[c], "collapse", "checkbox")
|
CreateConfig(U["raid"], T["Collapse Empty Slots"], C.unitframes[c], "collapse", "checkbox")
|
||||||
elseif c == "raidpet" then
|
elseif c == "raidpet" then
|
||||||
CreateConfig(U[c], T["Layout"], nil, nil, "header")
|
CreateConfig(U[c], T["Layout"], nil, nil, "header")
|
||||||
|
|||||||
+15
-21
@@ -30,8 +30,8 @@ pfUI:RegisterModule("raid", function ()
|
|||||||
-- flat pool of pet frames, laid out by LayoutPets (mirror or collapsed)
|
-- flat pool of pet frames, laid out by LayoutPets (mirror or collapsed)
|
||||||
pfUI.uf.raid.pets = {}
|
pfUI.uf.raid.pets = {}
|
||||||
|
|
||||||
-- 1-based grid slot -> (row, col) for the current fill direction, matching
|
-- 1-based grid slot -> (col, row) for the current fill direction, shared by
|
||||||
-- the raid grid's own fill loops.
|
-- the raid and pet grids.
|
||||||
local function SlotToCoord(slot, fill, x, y)
|
local function SlotToCoord(slot, fill, x, y)
|
||||||
slot = slot - 1
|
slot = slot - 1
|
||||||
if fill == "VERTICAL" then
|
if fill == "VERTICAL" then
|
||||||
@@ -75,12 +75,12 @@ pfUI:RegisterModule("raid", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local i = 1
|
|
||||||
local width = pfUI.uf.raid[1]:GetWidth()+2*default_border
|
local width = pfUI.uf.raid[1]:GetWidth()+2*default_border
|
||||||
local height = pfUI.uf.raid[1]:GetHeight()+2*default_border
|
local height = pfUI.uf.raid[1]:GetHeight()+2*default_border
|
||||||
local layout = pfUI.uf.raid[1].config.raidlayout
|
local layout = pfUI.uf.raid[1].config.raidlayout
|
||||||
local padding = tonumber(pfUI.uf.raid[1].config.raidpadding)*GetPerfectPixel()
|
local padding = tonumber(pfUI.uf.raid[1].config.raidpadding)*GetPerfectPixel()
|
||||||
local fill = pfUI.uf.raid[1].config.raidfill
|
local fill = pfUI.uf.raid[1].config.raidfill
|
||||||
|
local growleft = pfUI.uf.raid[1].config.raidgrowleft == "1"
|
||||||
local _, _, x, y = string.find(layout,"(.+)x(.+)")
|
local _, _, x, y = string.find(layout,"(.+)x(.+)")
|
||||||
x, y = tonumber(x), tonumber(y)
|
x, y = tonumber(x), tonumber(y)
|
||||||
|
|
||||||
@@ -95,24 +95,18 @@ pfUI:RegisterModule("raid", function ()
|
|||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|
||||||
if fill == "VERTICAL" then
|
-- right to left mirrors across the columns maxraid can fill, so a smaller
|
||||||
for r=1, x do for g=1, y do
|
-- raid stays next to the anchor instead of the far edge of the layout
|
||||||
if pfUI.uf.raid[i] then
|
local cols = min(x, fill == "VERTICAL" and ceil(maxraid / y) or maxraid)
|
||||||
pfUI.uf.raid[i]:ClearAllPoints()
|
|
||||||
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
for i=1, x*y do
|
||||||
UpdateMovable(pfUI.uf.raid[i], true)
|
if pfUI.uf.raid[i] then
|
||||||
end
|
local r, g = SlotToCoord(i, fill, x, y)
|
||||||
i = i + 1
|
if growleft then r = cols - r + 1 end
|
||||||
end end
|
pfUI.uf.raid[i]:ClearAllPoints()
|
||||||
else
|
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
||||||
for g=1, y do for r=1, x do
|
UpdateMovable(pfUI.uf.raid[i], true)
|
||||||
if pfUI.uf.raid[i] then
|
end
|
||||||
pfUI.uf.raid[i]:ClearAllPoints()
|
|
||||||
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
|
||||||
UpdateMovable(pfUI.uf.raid[i], true)
|
|
||||||
end
|
|
||||||
i = i + 1
|
|
||||||
end end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
self:LayoutPets()
|
self:LayoutPets()
|
||||||
|
|||||||
Reference in New Issue
Block a user