Me again with more tasty questions!
Ok, I spawn party pets not using a .xml template but by using the SecureGroupPetHeaderTemplate in the SpawnHeader option provided by oUF. All works fine, or did till...
I started sorting my Party Elements by Class. What happens now it's the Pet's are not parented to the owners but they simply are spawning where the header anchor is anchored to.
So... Code.
Party:
lua Code:
-- Party Frames
if cfg.show_PartyFrame and not cfg.party_inRaid_instead then
self:SetActiveStyle('lumen - Party')
local party = oUF:SpawnHeader('oUF_Party', nil, "custom [group:party,nogroup:raid][@raid6,noexists,group:raid] show;hide",
--local party = oUF:SpawnHeader('oUF_Party', nil, "party",
--local party = oUF:SpawnHeader('oUF_Party', nil, "solo", "showSolo", true, -- debug
"showParty", cfg.show_PartyFrame,
"showPlayer", cfg.show_Player_inParty,
"xoffset", 7,
"columnSpacing", 7,
"groupBy", "CLASS",
"groupingOrder", "WARRIOR,DRUID,PALADIN,DEATHKNIGHT,SHAMAN,PRIEST,MAGE,WARLOCK,ROGUE,HUNTER", -- Trying to put classes that can tank first
"point", "LEFT",
"columnAnchorPoint", "TOP",
"oUF-initialConfigFunction", ([[
self:SetWidth(%d)
self:SetHeight(%d)
self:SetScale(%d)
]]):format(cfg.party_width, cfg.party_height, cfg.scale))
party:SetPoint("CENTER", cfg.party_pos_x, cfg.party_pos_y)
end
Pets:
lua Code:
if cfg.show_PartyPetsFrame and cfg.show_PartyFrame and not cfg.party_inRaid_instead then
self:SetActiveStyle('lumen - Partypet')
local pets = oUF:SpawnHeader('oUF_PartyPets', 'SecureGroupPetHeaderTemplate', "custom [group:party,nogroup:raid][@raid6,noexists,group:raid] show;hide",
--local pets = oUF:SpawnHeader('oUF_PartyPets', 'SecureGroupPetHeaderTemplate', "solo", "showSolo", true, -- debug
"showParty", cfg.show_PartyFrame,
"showPlayer", cfg.show_Player_inParty,
"xoffset", 7,
"columnSpacing", 7,
"point", "LEFT",
"columnAnchorPoint", "TOP",
"oUF-initialConfigFunction", ([[
self:SetWidth(%d)
self:SetHeight(%d)
self:SetScale(%d)
]]):format(cfg.party_pets_width, cfg.party_pets_height, cfg.scale))
pets:SetPoint("TOPLEFT", "oUF_Party", "BOTTOMLEFT", 0, -6)
end
Anyone with a smart solution for this? Sorting the pets by class won't work for obvious reasons.