17#if CHECK_CLIENT_BUILD()
32 #if CHECK_CLIENT_BUILD()
33 static Client* getClient(lua_State *L);
34 static GUIEngine* getGuiEngine(lua_State *L);
50 T *scriptIfaceDowncast =
dynamic_cast<T*
>(scriptIface);
51 if (!scriptIfaceDowncast) {
52 throw LuaError(
"Requested unavailable ScriptApi - core engine bug!");
54 return scriptIfaceDowncast;
64 const luaL_Reg *methods,
65 const luaL_Reg *metamethods)
67 luaL_newmetatable(L, T::className);
68 luaL_register(L, NULL, metamethods);
69 int metatable = lua_gettop(L);
72 luaL_register(L, NULL, methods);
73 int methodtable = lua_gettop(L);
75 lua_pushvalue(L, methodtable);
76 lua_setfield(L, metatable,
"__index");
78 lua_getfield(L, metatable,
"__tostring");
79 bool default_tostring = lua_isnil(L, -1);
81 if (default_tostring) {
83 lua_setfield(L, metatable,
"__tostring");
87 lua_pushvalue(L, methodtable);
88 lua_setfield(L, metatable,
"__metatable");
97 return *
reinterpret_cast<T**
>(luaL_checkudata(L, narg, T::className));
113 static int l_deprecated_function(lua_State *L,
const char *good,
const char *bad, lua_CFunction func);
121 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:81
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:92
static void registerClass(lua_State *L, const luaL_Reg *methods, const luaL_Reg *metamethods)
Definition l_base.h:63
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:67
static int defaultToString(lua_State *L)
Definition l_base.h:118
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:48
static EmergeThread * getEmergeThread(lua_State *L)
Definition l_base.cpp:62
static T * checkObject(lua_State *L, int narg)
Definition l_base.h:95
Definition serverinventorymgr.h:17