17#if CHECK_CLIENT_BUILD()
33 #if CHECK_CLIENT_BUILD()
34 static Client* getClient(lua_State *L);
35 static GUIEngine* getGuiEngine(lua_State *L);
52 T *scriptIfaceDowncast =
dynamic_cast<T*
>(scriptIface);
53 if (!scriptIfaceDowncast) {
54 throw LuaError(
"Requested unavailable ScriptApi - core engine bug!");
56 return scriptIfaceDowncast;
66 const luaL_Reg *methods,
67 const luaL_Reg *metamethods)
69 luaL_newmetatable(L, T::className);
70 luaL_register(L, NULL, metamethods);
71 int metatable = lua_gettop(L);
74 luaL_register(L, NULL, methods);
75 int methodtable = lua_gettop(L);
77 lua_pushvalue(L, methodtable);
78 lua_setfield(L, metatable,
"__index");
80 lua_getfield(L, metatable,
"__tostring");
81 bool default_tostring = lua_isnil(L, -1);
83 if (default_tostring) {
85 lua_setfield(L, metatable,
"__tostring");
89 lua_pushvalue(L, methodtable);
90 lua_setfield(L, metatable,
"__metatable");
99 return *
reinterpret_cast<T**
>(luaL_checkudata(L, narg, T::className));
115 static int l_deprecated_function(lua_State *L,
const char *good,
const char *bad, lua_CFunction func);
123 lua_pushfstring(L,
"%s: %p", T::className, t);
Definition emerge_internal.h:25
Definition environment.h:31
implementation of main menu based uppon formspecs
Definition guiEngine.h:113
static bool registerFunction(lua_State *L, const char *name, lua_CFunction func, int top)
Definition l_base.cpp:86
static int l_deprecated_function(lua_State *L, const char *good, const char *bad, lua_CFunction func)
A wrapper for deprecated functions.
Definition l_base.cpp:97
static void registerClass(lua_State *L, const luaL_Reg *methods, const luaL_Reg *metamethods)
Definition l_base.h:65
static ServerInventoryManager * getServerInventoryMgr(lua_State *L)
Definition l_base.cpp:33
static Server * getServer(lua_State *L)
Definition l_base.cpp:28
static IGameDef * getGameDef(lua_State *L)
Definition l_base.cpp:45
static std::string getCurrentModPath(lua_State *L)
Definition l_base.cpp:72
static int defaultToString(lua_State *L)
Definition l_base.h:120
static ScriptApiBase * getScriptApiBase(lua_State *L)
Definition l_base.cpp:14
static Environment * getEnv(lua_State *L)
Definition l_base.cpp:50
static T * getScriptApi(lua_State *L)
Definition l_base.h:50
static EmergeThread * getEmergeThread(lua_State *L)
Definition l_base.cpp:67
static T * checkObject(lua_State *L, int narg)
Definition l_base.h:97
The thread that runs SSCSM code.
Definition sscsm_environment.h:26
Definition serverinventorymgr.h:17