View Single Post
09-13-10, 04:59 AM   #15
Cladhaire
Salad!
 
Cladhaire's Avatar
Premium Member
AddOn Author - Click to view addons
Join Date: Jul 2005
Posts: 1,935
That's a function of the code you've written, not whether or not its been written in Lua or XML. The global arguments are leftover from 1.x, and have been deprecated since 2.x. Also, if you use that for every single OnEvent handler, it obviously won't work since many events can pass upwards of 12 arguments. There's a reason that the WoW client sends them as variable arguments, and uses this. The conventions are all actually set by the way the WoW client passes arguments to the XML handlers, since we MUST match those names or it doesn't work. Luckily, they're sensible and well documented. See http://wowprogramming.com/docs/scripts/OnEvent.

When you see:

Code:
<Scripts>
  <OnEvent>
    foo blah bar
  </OnEvent>
</Scripts>
The bit inside the
Code:
<OnEvent>
is wrapped with
PHP Code:
function(selfevent, ...) 
and
PHP Code:
end 
The moral of the story is that both XML and Lua are valid tools for writing addons, and there are things you can do in Lua that you can't do easily in XML, and there are things you can do in XML that you can't do easily in Lua.

None of that, however, is relevant for this thread which is about the deprecation and final removal of the global arguments. That's what my original response was meant to indicate.
__________________
"There's only one thing that I know how to do well and I've often been told that you only can do what you know how to do well, and that's be you-- be what you're like-- be like yourself. And so I'm having a wonderful time, but I'd rather be whistling in the dark..."