mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-13 17:00:49 +00:00
raid: add option to limit amount of raidframes
This commit is contained in:
@@ -206,6 +206,7 @@ function pfUI:LoadConfig()
|
|||||||
pfUI:UpdateConfig("unitframes", nil, "selfingroup", "0")
|
pfUI:UpdateConfig("unitframes", nil, "selfingroup", "0")
|
||||||
pfUI:UpdateConfig("unitframes", nil, "selfinraid", "0")
|
pfUI:UpdateConfig("unitframes", nil, "selfinraid", "0")
|
||||||
pfUI:UpdateConfig("unitframes", nil, "raidforgroup", "0")
|
pfUI:UpdateConfig("unitframes", nil, "raidforgroup", "0")
|
||||||
|
pfUI:UpdateConfig("unitframes", nil, "maxraid", "40")
|
||||||
|
|
||||||
pfUI:UpdateConfig("unitframes", nil, "clickcast", "target")
|
pfUI:UpdateConfig("unitframes", nil, "clickcast", "target")
|
||||||
pfUI:UpdateConfig("unitframes", nil, "clickcast_shift", "")
|
pfUI:UpdateConfig("unitframes", nil, "clickcast_shift", "")
|
||||||
|
|||||||
@@ -866,6 +866,16 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
|||||||
"8:8 " .. T["Pixel"],
|
"8:8 " .. T["Pixel"],
|
||||||
"9:9 " .. T["Pixel"],
|
"9:9 " .. T["Pixel"],
|
||||||
},
|
},
|
||||||
|
["maxraid"] = {
|
||||||
|
"5:5",
|
||||||
|
"10:10",
|
||||||
|
"15:15",
|
||||||
|
"20:20",
|
||||||
|
"25:25",
|
||||||
|
"30:30",
|
||||||
|
"35:35",
|
||||||
|
"40:40",
|
||||||
|
},
|
||||||
["scaling"] = {
|
["scaling"] = {
|
||||||
"0:" .. T["Off"],
|
"0:" .. T["Off"],
|
||||||
"4:" .. T["Huge (PixelPerfect)"],
|
"4:" .. T["Huge (PixelPerfect)"],
|
||||||
@@ -1530,6 +1540,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
|
|||||||
CreateConfig(nil, T["Always Show Self In Raid Frames"], C.unitframes, "selfinraid", "checkbox")
|
CreateConfig(nil, T["Always Show Self In Raid Frames"], C.unitframes, "selfinraid", "checkbox")
|
||||||
CreateConfig(nil, T["Show Self In Group Frames"], C.unitframes, "selfingroup", "checkbox")
|
CreateConfig(nil, T["Show Self In Group Frames"], C.unitframes, "selfingroup", "checkbox")
|
||||||
CreateConfig(nil, T["Hide Group Frames While In Raid"], C.unitframes.group, "hide_in_raid", "checkbox")
|
CreateConfig(nil, T["Hide Group Frames While In Raid"], C.unitframes.group, "hide_in_raid", "checkbox")
|
||||||
|
CreateConfig(nil, T["Max Amount Of Raid Frames"], C.unitframes, "maxraid", "dropdown", pfUI.gui.dropdowns.maxraid)
|
||||||
|
|
||||||
CreateConfig(U[c], T["Colors"], nil, nil, "header")
|
CreateConfig(U[c], T["Colors"], nil, nil, "header")
|
||||||
CreateConfig(nil, T["Enable Pastel Colors"], C.unitframes, "pastel", "checkbox")
|
CreateConfig(nil, T["Enable Pastel Colors"], C.unitframes, "pastel", "checkbox")
|
||||||
|
|||||||
+15
-9
@@ -4,6 +4,7 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function ()
|
|||||||
|
|
||||||
pfUI.uf.raid = CreateFrame("Frame", "pfRaidUpdater", UIParent)
|
pfUI.uf.raid = CreateFrame("Frame", "pfRaidUpdater", UIParent)
|
||||||
|
|
||||||
|
local maxraid = tonumber(C.unitframes.maxraid)
|
||||||
local rawborder, default_border = GetBorderSize("unitframes")
|
local rawborder, default_border = GetBorderSize("unitframes")
|
||||||
local cluster = CreateFrame("Frame", "pfRaidCluster", UIParent)
|
local cluster = CreateFrame("Frame", "pfRaidCluster", UIParent)
|
||||||
cluster:SetFrameLevel(20)
|
cluster:SetFrameLevel(20)
|
||||||
@@ -21,8 +22,9 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function ()
|
|||||||
|
|
||||||
function pfUI.uf.raid:UpdateConfig()
|
function pfUI.uf.raid:UpdateConfig()
|
||||||
local rawborder, default_border = GetBorderSize("unitframes")
|
local rawborder, default_border = GetBorderSize("unitframes")
|
||||||
|
maxraid = tonumber(C.unitframes.maxraid)
|
||||||
|
|
||||||
for i=1,40 do
|
for i=1,maxraid do
|
||||||
pfUI.uf.raid[i] = pfUI.uf.raid[i] or pfUI.uf:CreateUnitFrame("Raid", i, C.unitframes.raid)
|
pfUI.uf.raid[i] = pfUI.uf.raid[i] or pfUI.uf:CreateUnitFrame("Raid", i, C.unitframes.raid)
|
||||||
pfUI.uf.raid[i]:SetParent(cluster)
|
pfUI.uf.raid[i]:SetParent(cluster)
|
||||||
pfUI.uf.raid[i]:SetFrameLevel(5)
|
pfUI.uf.raid[i]:SetFrameLevel(5)
|
||||||
@@ -42,16 +44,20 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function ()
|
|||||||
|
|
||||||
if fill == "VERTICAL" then
|
if fill == "VERTICAL" then
|
||||||
for r=1, x do for g=1, y do
|
for r=1, x do for g=1, y do
|
||||||
pfUI.uf.raid[i]:ClearAllPoints()
|
if pfUI.uf.raid[i] then
|
||||||
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
pfUI.uf.raid[i]:ClearAllPoints()
|
||||||
UpdateMovable(pfUI.uf.raid[i], true)
|
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
||||||
|
UpdateMovable(pfUI.uf.raid[i], true)
|
||||||
|
end
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end end
|
end end
|
||||||
else
|
else
|
||||||
for g=1, y do for r=1, x do
|
for g=1, y do for r=1, x do
|
||||||
pfUI.uf.raid[i]:ClearAllPoints()
|
if pfUI.uf.raid[i] then
|
||||||
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
pfUI.uf.raid[i]:ClearAllPoints()
|
||||||
UpdateMovable(pfUI.uf.raid[i], true)
|
pfUI.uf.raid[i]:SetPoint("BOTTOMLEFT", (r-1)*(padding+width), (g-1)*(padding+height))
|
||||||
|
UpdateMovable(pfUI.uf.raid[i], true)
|
||||||
|
end
|
||||||
i = i + 1
|
i = i + 1
|
||||||
end end
|
end end
|
||||||
end
|
end
|
||||||
@@ -69,7 +75,7 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function ()
|
|||||||
function pfUI.uf.raid:AddUnitToGroup(index, group)
|
function pfUI.uf.raid:AddUnitToGroup(index, group)
|
||||||
for subindex = 1, 5 do
|
for subindex = 1, 5 do
|
||||||
local ids = subindex + 5*(group-1)
|
local ids = subindex + 5*(group-1)
|
||||||
if pfUI.uf.raid[ids].id == 0 and pfUI.uf.raid[ids].config.visible == "1" then
|
if pfUI.uf.raid[ids] and pfUI.uf.raid[ids].id == 0 and pfUI.uf.raid[ids].config.visible == "1" then
|
||||||
SetRaidIndex(pfUI.uf.raid[ids], index)
|
SetRaidIndex(pfUI.uf.raid[ids], index)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
@@ -85,7 +91,7 @@ pfUI:RegisterModule("raid", "vanilla:tbc", function ()
|
|||||||
if not UnitInRaid("player") or (InCombatLockdown and InCombatLockdown()) then return end
|
if not UnitInRaid("player") or (InCombatLockdown and InCombatLockdown()) then return end
|
||||||
|
|
||||||
-- clear all existing frames
|
-- clear all existing frames
|
||||||
for i=1, 40 do SetRaidIndex(pfUI.uf.raid[i], 0) end
|
for i=1, maxraid do SetRaidIndex(pfUI.uf.raid[i], 0) end
|
||||||
|
|
||||||
-- sort tanks into their groups
|
-- sort tanks into their groups
|
||||||
for i=1, GetNumRaidMembers() do
|
for i=1, GetNumRaidMembers() do
|
||||||
|
|||||||
Reference in New Issue
Block a user