|
|
#1 |
|
Senior Member
Join Date: Jun 2006
Posts: 483
|
Someone mentioned to use two metatables to replace the AceOO stuff. Is there an article or example that we can point to to explain how to do this? I'm thinking of ppl that do normally do lua OO but would like to undertake the conversion of an addon that is no longer maintain.
|
|
|
|
|
|
#2 | |
|
Legendary Member
Join Date: Dec 2006
Posts: 2,321
|
Quote:
__________________
Author of Inline Aura, AdiBags, Squire2 and several other addons. Each time you hit your "copy" command with a block of code, think about a way to refactor it so it did what you want without using the "paste" command. |
|
|
|
|
|
|
#3 |
|
Super Moderator
Join Date: Aug 2005
Location: Germany/Hamburg
Posts: 1,783
|
I moved your posts to a new thread.
On the topic: I don't 100% remember how AceOO worked, never liked it, never extensively used it. But the basic OO principles are really easy to "fake" in Lua. I'll look for an article when i get home, maybe i can find a good one again. I'm sure others will have them around as well, or will just explain here.
__________________
Author/Maintainer of Ace3, Bartender, Mapster, Quartz, HotCandy, and various small and helpful addons WoWAce Administrator and AddOn Moderator You can Donate if you want, any help is appreciated! Last edited by Nevcairiel; 07-16-2010 at 11:45 AM. |
|
|
|
|
|
#4 |
|
Legendary Member
Join Date: Dec 2006
Posts: 2,321
|
A part of AceOO were used in AceAddon-2.0 and AceModule-2.0 (or whatever allowed to create modules). This part is taken care of by AceAddon-3.0.
If the addon called AceOO directly, there might be more things to do. Here a basic OOP stub: http://paste.wowace.com/2201/ The idea is to use the "__index" operation of lua metable that is used to look up for missing keys in other tables (or to be handled by a function, but we are not interested in that feature).
__________________
Author of Inline Aura, AdiBags, Squire2 and several other addons. Each time you hit your "copy" command with a block of code, think about a way to refactor it so it did what you want without using the "paste" command. |
|
|
|
|
|
#5 |
|
Amazing Member
Join Date: Feb 2005
Posts: 1,076
|
For an introduction that is not specific to WoW (but applies in all cases to WoW addons), here are links into a book written by one of the Lua architects:
http://www.lua.org/pil/13.4.html (metatable usage) http://www.lua.org/pil/16.html (OO stuff) |
|
|
|
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
|
|
All times are GMT. The time now is 01:07 PM.
WowAce Forums





