Not every component of the unit frame needs to be named (global). Why not just:
Code:
local frame = Create("Frame", "GUI_Party" .. i .. ''Frame", UIParent, "SecureUnitButtonTemplate")
frame.pedestal = Create("Frame", nil, frame)
I would also save the unit with the frame so that you don't have to keep concating it:
Code:
frame.unit = "party" .. i
Then you could do something such as:
Code:
function GrimUI.PartyStyle1NameTextEvents(self)
if UnitExists(self.unit) == 1 then
self.nameText:SetFormattedText("%s", UnitName(self.unit))
end
self:ApplyNameColoring()
end