View Single Post
06-15-10, 09:30 AM   #2
Vrul
A Scalebane Royal Guard
 
Vrul's Avatar
AddOn Author - Click to view addons
Join Date: Nov 2007
Posts: 404
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
  Reply With Quote