From 777242fce3c15d76109aba0da1547b34ff08a7da Mon Sep 17 00:00:00 2001 From: Rodrigo Braz Monteiro Date: Sun, 9 Mar 2008 21:36:24 +0000 Subject: [PATCH] 2000 GET!! Changed how the Lua factory is registered. Originally committed to SVN as r2000. --- aegisub/auto4_lua.h | 8 +++++--- aegisub/plugin_manager.cpp | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/aegisub/auto4_lua.h b/aegisub/auto4_lua.h index de2ae1b48..0e4ecfd62 100644 --- a/aegisub/auto4_lua.h +++ b/aegisub/auto4_lua.h @@ -255,15 +255,17 @@ namespace Automation4 { // Factory class for Lua scripts class LuaScriptFactory : public ScriptFactory { public: - LuaScriptFactory() + LuaScriptFactory() { } + + ~LuaScriptFactory() { } + + void RegisterFactory () { engine_name = _T("Lua"); filename_pattern = _T("*.lua"); Register(this); } - ~LuaScriptFactory() { } - virtual Script* Produce(const wxString &filename) const { // Just check if file extension is .lua diff --git a/aegisub/plugin_manager.cpp b/aegisub/plugin_manager.cpp index 7eaef4ec4..23fa2632c 100644 --- a/aegisub/plugin_manager.cpp +++ b/aegisub/plugin_manager.cpp @@ -82,7 +82,8 @@ void PluginManager::RegisterBuiltInPlugins() { // Automation languages #ifdef WITH_AUTO4_LUA - new Automation4::LuaScriptFactory(); + Automation4::LuaScriptFactory *lua = new Automation4::LuaScriptFactory(); + lua->RegisterFactory(); #endif #ifdef WITH_PERL Automation4::PerlScriptFactory *perl = new Automation4::PerlScriptFactory();