06-14-2012, 01:47 AM
(06-14-2012, 01:26 AM)xoft Wrote: No, Taugeshtu, those are actually the new plugins already. The old plugins are ones that are set in the settings.ini by Plugin=<name>, rather than NewPlugin=<name>. They have a completely different architecture, from what I can gather. I don't even think all the new hooks work in them. I certainly didn't write any glue code for that.
Taugeshtu is right though
The old plugins don't need any glue code, that's what the metatable crap was for. The old plugins use some hacky way of inheriting and instantiating a cPlugin class. ToLua++ creates all the glue needed for that in a class called Lua__cPlugin automagically.
I first thought I could have Lua files that would contain multiple plugins. But that idea is pretty useless I noticed back when I created the new Lua interface. It's much easier and cleaner to have a single cPlugin instance per Lua plugin and stop trying to force C++ idioms to Lua.