Bit of a necro, but i finally found out how to force show header units!
Bear in mind this is only for party, probably need some extra work for raid frames.
Lua Code:
-- self.header is the header that's spawned using oUF:SpawnHeader
-- script forcing the frames to show
frame:SetScript("OnShow", function(self)
SecureStateDriverManager:SetAttribute("setframe", self.header) -- This is just a "hack" to get the old visibility attribute
self.oldstate_driver = SecureStateDriverManager:GetAttribute("setstate"):gsub("state%-visibility%s", "") -- ^
self.header:SetAttribute("startingIndex", -2) -- Setting the starting index to -2, so we have three frames: -2, -1, 0
self.header:SetAttribute("showSolo", true) -- This is the forth frame
RegisterAttributeDriver(self.header, 'state-visibility', 'show') -- Setting it to show
for i = 1, self.header:GetNumChildren() do -- We can now get all the 4 children
local obj = select(i, self.header:GetChildren())
ToggleUnitFrame(obj, true) -- This function just sets the obj.unit = "player" etc. And showing it
end
end)
-- Script to reset the header
frame:SetScript("OnHide", function(self)
RegisterAttributeDriver(self.header, "state-visibility", self.oldstate_driver) -- Reset the visibility
self.oldstate_driver = nil
self.header:SetAttribute("startingIndex", nil) -- Setting it to default (1)
self.header:SetAttribute("showSolo", nil)
for i = 1, self.header:GetNumChildren() do
local obj = select(i, self.header:GetChildren())
ToggleUnitFrame(obj) -- Same as above,
obj:UpdateAllElements("OnShow")
end
end)
Edit: Looks like you don't need showsolo, not sure why i added that. Just reduce the startingindex by 1 instead. And also, you need to check how many of your frames that are actually shown and increment the startingIndex by one for each frame shown, so you don't create 4 extra frames if you're in a party of 4 (giving a total of 8 partyframes!)