I a not sure, is this the correct way to implement multiple styles in one layout? Under the premission I want to use one style func for each spawn. I know that I could just use one style func with unit conditions, but I want to split the unit spawn in different style funcs that might call the same functions (create_me_a_castbar etc.) or not, depending on how I set up the style.
Code:
local function CreatePlayerStyle(self, unit)
--do stuff
end
local function CreateTargetStyle(self, unit)
--do stuff
end
local function CreateTargetTargetStyle(self, unit)
--do stuff
end
local function CreateFocusStyle(self, unit)
--do stuff
end
local function CreatePetStyle(self, unit)
--do stuff
end
oUF:RegisterStyle("player", CreatePlayerStyle)
oUF:RegisterStyle("target", CreateTargetStyle)
oUF:RegisterStyle("tot", CreateTargetTargetStyle)
oUF:RegisterStyle("focus", CreateFocusStyle)
oUF:RegisterStyle("pet", CreatePetStyle)
oUF:SetActiveStyle("player")
oUF:Spawn("player", "oUF_player"):SetPoint("CENTER", 0, 0)
oUF:SetActiveStyle("target")
oUF:Spawn("target", "oUF_target"):SetPoint("CENTER", 0, 0)
oUF:SetActiveStyle("tot")
oUF:Spawn("targettarget", "ouf_tot"):SetPoint("CENTER", 0, 0)
oUF:SetActiveStyle("focus")
oUF:Spawn("focus", "oUF_focus"):SetPoint("CENTER", 0, 0)
oUF:SetActiveStyle("pet")
oUF:Spawn("pet", "oUF_pet"):SetPoint("CENTER", 0, 0)