My problem with party pets etc. does not come from not being able to spawn them - at least party pets are easy via xml, even though I've not yet tried to spawn arena frames. The problem is how to address them, aka how to change the size etc. since they inherit those from it's parent (party) and you don't want to have party pets the size of your party and a lot of the functions (let's say portraits or something), neither.
For example I spawn my units like you do in lilly and classic.
via
Code:
local UnitSpecific = {
player = function(self)
end,
and party raid via (separate, because of self.Range)
Code:
UnitSpecific.party = function(self)
....
end
Now where to put things like (self:GetName():match"oUF_Arena") ? It throws an error if you try to put it somewhere else, but the shared style. Thing is I have all things like castbar, portraits, borders, etc. in between the shared style function and the unit.specific functions. And all are separate functions that I call only in those units I want the function to be part of. For example "function = createCastbar(self, unit)" is called via "createCastbar(self)" for player, target and focus, only.
It just doesn't seem very clean to spawn everything via a function and having to "go back" to things like ...
if unit == (self:GetName():match"oUF_Arena") then ...
... for certain units? Feels shabby and brings up some problems with how to bring functions in the right order, imho.
Do I have to do something like
Code:
local PartyPet = self:GetAttribute("unitsuffix") == "pet"
and then put it in here? But where to put the local without an error on "self"?
Code:
UnitSpecific.party = function(self)
....
if unitIsPartyPet then
*whole different story than "UnitSpecific.party"*
end
end