View Single Post
06-15-10, 05:06 PM   #21
Grimsin
A Molten Giant
 
Grimsin's Avatar
AddOn Author - Click to view addons
Join Date: Sep 2006
Posts: 990
Originally Posted by v6o View Post
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:
  1. local function GUISetPartyEventScripts(id)
  2.     local frame = _G['GrimUIPartyFrame' .. id]
  3.     frame.GUIHealthEvents:SetScript("OnEvent", GrimUI.HealthEventFunc)
  4.  
  5.     frame.GUIManaEvents:SetScript("OnEvent", GrimUI.ManaEventFunc)
  6.  
  7.     frame.GUINameTextEvents:SetScript("OnEvent", GrimUI.PartyNameTextEvents)
  8.  
  9.     frame.GUILvlClassTextEvents:SetScript("OnEvent", GrimUI.LvlClassTextEvents)
  10.  
  11.     frame.GUIpvpIconEvent:SetScript("OnEvent", GrimUI.pvpIconEvent)
  12.  
  13.     frame.GUIPartyLeaderEvent:SetScript("OnEvent", GrimUI.PartyLeaderEvent)
  14.  
  15.     frame.GUIOffLineDeadEvents:SetScript("OnEvent", GrimUI.DeadOffLineEvents)
  16.  
  17.     frame.GUItargetOfFrameEvents:SetScript("OnEvent", GrimUI.TargEventFunc)
  18. end
  19.  
  20. for id = 1, 4 do
  21.     GUISetPartyEventScripts(id)
  22. end
__________________
"Are we there yet?"

GrimUI
[SIGPIC][/SIGPIC]

Last edited by Grimsin : 06-15-10 at 05:16 PM.
  Reply With Quote