Originally Posted by v6o
What Xrystal said is the easiest way to handle multiple frames; let them handle their own events.
And for the "self error"; You're doing it wrong here. You're not passing self as the first argument.
should be
No point creating the small extra function, this also passes all arguments.
|
yea
this is all falling into place more as i go along, i had not figured that part out yet before i needed to have a bunch of those functions inside the setscript... now i only need one
edit -- v6o -- if i do GrimUI.PartyNameTextEvents without (self) at the end it knows that function needs to work onitself right? so when i do the setscript there are no (self)'s in the mater? it knows to get the (self) on GrimUI.PartyNameTextEvents automatically?
edit -- oh yea im not actually getting errors or even trying any of this in game right now... im working all based on theory. i want to understand whats going on so it becomes easier to write code without so much guess and check... i just figured there would be a self error there based on the theory of the mater...
edit -- made it look like this based on that idea...
lua Code:
local function GUISetPartyEventScripts(id)
local frame = _G['GrimUIPartyFrame' .. id]
frame.GUIHealthEvents:SetScript("OnEvent", GrimUI.HealthEventFunc)
frame.GUIManaEvents:SetScript("OnEvent", GrimUI.ManaEventFunc)
frame.GUINameTextEvents:SetScript("OnEvent", GrimUI.PartyNameTextEvents)
frame.GUILvlClassTextEvents:SetScript("OnEvent", GrimUI.LvlClassTextEvents)
frame.GUIpvpIconEvent:SetScript("OnEvent", GrimUI.pvpIconEvent)
frame.GUIPartyLeaderEvent:SetScript("OnEvent", GrimUI.PartyLeaderEvent)
frame.GUIOffLineDeadEvents:SetScript("OnEvent", GrimUI.DeadOffLineEvents)
frame.GUItargetOfFrameEvents:SetScript("OnEvent", GrimUI.TargEventFunc)
end
for id = 1, 4 do
GUISetPartyEventScripts(id)
end