|
UFO: Alien Invasion
|
Basic lua initialization for the client. More...
#include "cl_lua.h"#include "../../shared/cxx.h"#include "../../shared/defines.h"#include "../../shared/shared.h"#include "../../common/hashtable.h"#include "../../common/filesys.h"
Go to the source code of this file.
Functions | |
| int | luaopen_ufo (lua_State *L) |
| static int | CL_UfoModuleLoader (lua_State *L) |
| Loader that enables the lua files to access .ufo files through the ufo filesystem. | |
| static void | CL_InsertModuleLoader (lua_State *L) |
| This function adds loader to the lua table of module loaders that enables lua to access the ufo filesystem. | |
| void | CL_InitLua (void) |
| Initializes the ui-lua interfacing environment. | |
| void | CL_ShutdownLua (void) |
| Shutdown the ui-lua interfacing environment. | |
| lua_State * | CL_GetLuaState (void) |
| Returns the lua state for the client side. | |
| void | CL_RegisterCallback (const char *key, LUA_FUNCTION fnc) |
| Registers a lua callback function with a key. | |
| void | CL_ExecuteCallback (lua_State *L, const char *key) |
| Calls the registered lua onload callback function. | |
Variables | |
| lua_State * | cl_luastate = nullptr |
| hashTable_s * | cl_callback = nullptr |
Basic lua initialization for the client.
Definition in file cl_lua.cpp.
| void CL_ExecuteCallback | ( | lua_State * | L, |
| const char * | key ) |
Calls the registered lua onload callback function.
| [in] | L | The lua state for calling lua. |
| [in] | key | script The name of the .ufo file holding the lua script. |
Definition at line 194 of file cl_lua.cpp.
References cl_callback, cl_luastate, Com_Printf(), HASH_Get(), and key.
Referenced by UI_CallHandler_OnLoad().
| lua_State * CL_GetLuaState | ( | void | ) |
Returns the lua state for the client side.
Definition at line 166 of file cl_lua.cpp.
References cl_luastate.
Referenced by UI_ExecuteLuaConFunc(), UI_ExecuteLuaEventScript(), UI_ExecuteLuaEventScript_DragDrop(), UI_ExecuteLuaEventScript_DragDrop_IsDropped(), UI_ExecuteLuaEventScript_DragDrop_XY(), UI_ExecuteLuaEventScript_DxDy(), UI_ExecuteLuaEventScript_Key(), UI_ExecuteLuaEventScript_ParamList(), UI_ExecuteLuaEventScript_ReturnBool(), UI_ExecuteLuaEventScript_XY(), UI_ExecuteLuaMethod(), and UI_ParseAndLoadLuaScript().
Initializes the ui-lua interfacing environment.
Definition at line 130 of file cl_lua.cpp.
References cl_callback, CL_InsertModuleLoader(), cl_luastate, CL_ShutdownLua(), HASH_NewTable(), and luaopen_ufo().
Referenced by CL_Init(), CampaignTest::SetUpTestCase(), FootStepTest::SetUpTestCase(), MapDefMassRMATest::SetUpTestCase(), MapDefStatsTest::SetUpTestCase(), MapDefTest::SetUpTestCase(), ParticleTest::SetUpTestCase(), ScriptTest::SetUpTestCase(), and UILevel2Test::SetUpTestCase().
|
static |
This function adds loader to the lua table of module loaders that enables lua to access the ufo filesystem.
Definition at line 88 of file cl_lua.cpp.
References CL_UfoModuleLoader().
Referenced by CL_InitLua().
| void CL_RegisterCallback | ( | const char * | key, |
| LUA_FUNCTION | fnc ) |
Registers a lua callback function with a key.
| key | A key for finding the callback function by name, usually the script name. |
| fnc | A lua function registered in the lua registry index. |
Definition at line 175 of file cl_lua.cpp.
References cl_callback, Com_Printf(), HASH_Insert(), int(), key, and len.
Referenced by UI_RegisterHandler_OnLoad().
Shutdown the ui-lua interfacing environment.
Definition at line 155 of file cl_lua.cpp.
References cl_callback, cl_luastate, and HASH_DeleteTable().
Referenced by CL_InitLua(), CL_Shutdown(), and TEST_Shutdown().
|
static |
Loader that enables the lua files to access .ufo files through the ufo filesystem.
Definition at line 47 of file cl_lua.cpp.
References Com_Printf(), Com_sprintf(), FS_LoadFile(), len, and name.
Referenced by CL_InsertModuleLoader().
| int luaopen_ufo | ( | lua_State * | L | ) |
Referenced by CL_InitLua().
| hashTable_s* cl_callback = nullptr |
Definition at line 37 of file cl_lua.cpp.
Referenced by CL_ExecuteCallback(), CL_InitLua(), CL_RegisterCallback(), and CL_ShutdownLua().
| lua_State* cl_luastate = nullptr |
Definition at line 35 of file cl_lua.cpp.
Referenced by CL_ExecuteCallback(), CL_GetLuaState(), CL_InitLua(), and CL_ShutdownLua().