void luasrc_init (void) { if (g_bLuaInitialized) return; g_bLuaInitialized = true; L = lua_open(); luaL_openlibs(L); base_open(L); luaopen_CBaseCombatWeapon(L); luaopen_CBaseEntity(L); luaopen_CBasePlayer(L); luaopen_Color(L); luaopen_ConCommand(L); luaopen_ConVar(L); luaopen_dbg(L); luaopen_engine(L); luaopen_filesystem(L); luaopen_gpGlobals(L); luaopen_cvar(L); luaopen_helpers(L); luaopen_g_pVoiceServer(L); luaopen_randomStr(L); luaopen_UTIL(L); luaopen_Vector(L); luaopen_QAngle(L); Msg( "Lua initialized (" LUA_VERSION ")\n" ); }
bool AutotestingSystemLua::LoadWrappedLuaObjects() { if(!luaState) return false; //TODO: report error? bool ret = true; luaopen_AutotestingSystem(luaState); // load the wrappered module luaopen_UIControl(luaState); // load the wrappered module luaopen_Rect(luaState); // load the wrappered module luaopen_Vector(luaState); // load the wrappered module luaopen_KeyedArchive(luaState); // load the wrappered module if(delegate) { ret = delegate->LoadWrappedLuaObjects(luaState); } //TODO: check if modules really loaded return ret; }