Thread Tools Display Modes
Prev Previous Post   Next Post Next
08-25-14, 06:02 PM   #21
Sharparam
A Flamescale Wyrmkin
 
Sharparam's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2011
Posts: 102
Originally Posted by Phanx View Post
So... either use the normal Frame event/script system, or name your method something else? Still not seeing how this is leading to using a default API method name for your own custom method is in any way beneficial, regardless of whether you're defining it on a Frame object or a plain table. If I see "object:SetScript" in WoW addon code, the only reasonable assumption to make is that "object" is a frame of some type, and "SetScript" is the standard "SetScript" method that comes with a frame object.
The default frame supports firing custom events and multiple callback functions?

I suppose naming conventions in projects can have an effect on what the assumed type of an object is, I tend to have "frame" in variable names for frames.

Originally Posted by Phanx View Post
If you have no idea what methods a Frame object comes with, you should take your hands off the keyboard and go look at some API documentation before proceeding.
I think few people know every single method and field on WoW's API components without looking up at least a few.

Originally Posted by Phanx View Post
Ugh, MoonScript. Someone (maybe you) posted a link to that recently, and the official examples of Lua code it generates about made me vomit. It's horrible.... but I guess if you're not actually programming in Lua, and you're writing your addons in some Python-like pseudo-code that generates Lua code on par with the HTML generated by MS Front Page circa 1997, that probably explains why you're arguing in favor or something that makes no sense.
I don't think the output is meant to be readable. As for how it performs compared to writing in plain Lua I'm not sure as i haven't made a comparative performance test. It's certainly not, however, pseudo-code. And try doing something like classes and inheritance in Lua, it's possible but quite a bit of work that MoonScript does for you while also having it look nice. (Should be noted I only have one addon in MoonScript for mostly testing the (very real and runnable) language, liking it so far though)
  Reply With Quote
 

WoWInterface » Developer Discussions » Lua/XML Help » Help with an addon i am making.

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off