Here is what I do for now:
Lua Code:
if cfg.units.raid.show then
--register style
oUF:RegisterStyle("diablo:raid", createStyle)
oUF:SetActiveStyle("diablo:raid")
local attr = cfg.units.raid.attributes
local raidDragFrame = CreateFrame("Frame", "oUF_DiabloRaidDragFrame", UIParent)
raidDragFrame:SetSize(50,50)
raidDragFrame:SetPoint(cfg.units.raid.pos.a1,cfg.units.raid.pos.af,cfg.units.raid.pos.a2,cfg.units.raid.pos.x,cfg.units.raid.pos.y)
func.applyDragFunctionality(raidDragFrame)
table.insert(oUF_Diablo_Units,"oUF_DiabloRaidDragFrame") --add frames to the slash command function
local groups, group = {}, nil
for i=1, NUM_RAID_GROUPS do
local name = "oUF_DiabloRaidGroup"..i
group = oUF:SpawnHeader(
name,
nil,
attr.visibility,
"showPlayer", attr.showPlayer,
"showSolo", attr.showSolo,
"showParty", attr.showParty,
"showRaid", attr.showRaid,
"point", attr.point,
"yOffset", attr.yOffset,
"xoffset", attr.xoffset,
"groupFilter", tostring(i),
"unitsPerColumn", 5,
--"unitsPerColumn", attr.unitsPerColumn,
--"columnSpacing", attr.columnSpacing,
--"columnAnchorPoint", attr.columnAnchorPoint,
"oUF-initialConfigFunction", ([[
self:SetWidth(%d)
self:SetHeight(%d)
]]):format(128, 64)
)
if i == 1 then
group:SetPoint("TOPLEFT",raidDragFrame,0,0)
else
if attr.columnAnchorPoint == "TOP" then
group:SetPoint("TOPLEFT", groups[i-1], "BOTTOMLEFT", 0, attr.columnSpacing)
elseif attr.columnAnchorPoint == "BOTTOM" then
group:SetPoint("BOTTOMLEFT", groups[i-1], "TOPLEFT", 0, attr.columnSpacing)
elseif attr.columnAnchorPoint == "LEFT" then
group:SetPoint("TOPLEFT", groups[i-1], "TOPRIGHT", attr.columnSpacing, 0)
else
group:SetPoint("TOPRIGHT", groups[i-1], "TOPLEFT", attr.columnSpacing, 0)
end
end
groups[i] = group
end
local updateRaidScale = CreateFrame("Frame")
updateRaidScale:RegisterEvent("GROUP_ROSTER_UPDATE")
updateRaidScale:RegisterEvent("PLAYER_ENTERING_WORLD")
updateRaidScale:SetScript("OnEvent", function(self)
if(InCombatLockdown()) then
self:RegisterEvent("PLAYER_REGEN_ENABLED")
else
self:UnregisterEvent("PLAYER_REGEN_ENABLED")
local num = GetNumGroupMembers()
local scale = (100-num)/100*cfg.units.raid.scale
for idx, group in pairs(groups) do
if group then
group:SetScale(scale)
end
end
end
end)
end
So I check for out of combat and do my adjustments if needed.