From e1bbfb74faa4acf1b044c7fcbffcacad7acb75b3 Mon Sep 17 00:00:00 2001 From: dfighter1985 Date: Mon, 9 Jul 2012 03:07:19 +0200 Subject: [PATCH] CHANGED: #1471 CInterfaceParser no longer depends on CLuaIHMRyzom. --- .../client/src/interface_v3/interface_manager.cpp | 13 +++++++++++++ .../client/src/interface_v3/interface_manager.h | 2 ++ .../client/src/interface_v3/interface_parser.cpp | 4 ---- .../client/src/interface_v3/interface_parser.h | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/code/ryzom/client/src/interface_v3/interface_manager.cpp b/code/ryzom/client/src/interface_v3/interface_manager.cpp index 39e942ede..87b1505dd 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.cpp +++ b/code/ryzom/client/src/interface_v3/interface_manager.cpp @@ -585,6 +585,19 @@ void CInterfaceManager::destroy () _Instance = NULL; } +void CInterfaceManager::initLUA() +{ + if( _LuaState != NULL ) + return; + + CInterfaceParser::initLUA(); + + if( _LuaState == NULL ) + return; + + CLuaIHMRyzom::RegisterRyzomFunctions( *_LuaState ); +} + // ------------------------------------------------------------------------------------------------ void CInterfaceManager::initLogin() { diff --git a/code/ryzom/client/src/interface_v3/interface_manager.h b/code/ryzom/client/src/interface_v3/interface_manager.h index 121504846..55c8d3f4a 100644 --- a/code/ryzom/client/src/interface_v3/interface_manager.h +++ b/code/ryzom/client/src/interface_v3/interface_manager.h @@ -146,6 +146,8 @@ public: void setInGame( bool i ); bool isInGame() const { return _InGame; } + void initLUA(); + /// initialize the whole login interface void initLogin(); diff --git a/code/ryzom/client/src/interface_v3/interface_parser.cpp b/code/ryzom/client/src/interface_v3/interface_parser.cpp index 76d378963..8d66ae077 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.cpp +++ b/code/ryzom/client/src/interface_v3/interface_parser.cpp @@ -34,9 +34,6 @@ #include "nel/gui/lua_ihm.h" #include "nel/gui/lua_manager.h" -#include "lua_ihm_ryzom.h" - - #ifdef LUA_NEVRAX_VERSION #include "lua_ide_dll_nevrax/include/lua_ide_dll/ide_interface.h" // external debugger #endif @@ -2856,7 +2853,6 @@ void CInterfaceParser::initLUA() // register LUA methods CLuaIHM::registerAll(*_LuaState); - CLuaIHMRyzom::RegisterRyzomFunctions( *_LuaState ); } // *************************************************************************** diff --git a/code/ryzom/client/src/interface_v3/interface_parser.h b/code/ryzom/client/src/interface_v3/interface_parser.h index c78d87577..b28a2ab9e 100644 --- a/code/ryzom/client/src/interface_v3/interface_parser.h +++ b/code/ryzom/client/src/interface_v3/interface_parser.h @@ -344,8 +344,8 @@ protected: // ---------------------------------------------------------------------------------- // LUA Interface State. NB: The LUA environnement is not shared between Login/OutGame/InGame NLMISC::CSmartPtr _LuaState; - void initLUA(); - void uninitLUA(); + virtual void initLUA(); + void uninitLUA(); // List of script loaded (for reloadLua command) std::set _LuaFileScripts; // Load A .lua. false if parse error. string 'error' contains the eventual error desc (but warning still displayed)