Implementation of lua api support for mainmenu. More...
#include <l_mainmenu.h>
Static Public Member Functions | |
static void | Initialize (lua_State *L, int top) |
initialize this API module More... | |
static void | InitializeAsync (lua_State *L, int top) |
Static Public Member Functions inherited from ModApiBase | |
static ScriptApiBase * | getScriptApiBase (lua_State *L) |
static Server * | getServer (lua_State *L) |
static ServerInventoryManager * | getServerInventoryMgr (lua_State *L) |
static Client * | getClient (lua_State *L) |
static GUIEngine * | getGuiEngine (lua_State *L) |
static IGameDef * | getGameDef (lua_State *L) |
static Environment * | getEnv (lua_State *L) |
static std::string | getCurrentModPath (lua_State *L) |
template<typename T > | |
static T * | getScriptApi (lua_State *L) |
static bool | registerFunction (lua_State *L, const char *name, lua_CFunction func, int top) |
static int | l_deprecated_function (lua_State *L, const char *good, const char *bad, lua_CFunction func) |
A wrapper for deprecated functions. More... | |
Static Private Member Functions | |
static std::string | getTextData (lua_State *L, std::string name) |
read a text variable from gamedata table within lua stack More... | |
static int | getIntegerData (lua_State *L, std::string name, bool &valid) |
read a integer variable from gamedata table within lua stack More... | |
static int | getBoolData (lua_State *L, std::string name, bool &valid) |
read a bool variable from gamedata table within lua stack More... | |
static bool | mayModifyPath (const std::string &path) |
Checks if a path may be modified. More... | |
static int | l_start (lua_State *L) |
static int | l_close (lua_State *L) |
static int | l_create_world (lua_State *L) |
static int | l_delete_world (lua_State *L) |
static int | l_get_worlds (lua_State *L) |
static int | l_get_mapgen_names (lua_State *L) |
static int | l_gettext (lua_State *L) |
static int | l_get_games (lua_State *L) |
static int | l_get_content_info (lua_State *L) |
static int | l_show_keys_menu (lua_State *L) |
static int | l_show_path_select_dialog (lua_State *L) |
static int | l_set_topleft_text (lua_State *L) |
static int | l_set_clouds (lua_State *L) |
static int | l_get_textlist_index (lua_State *L) |
static int | l_get_table_index (lua_State *L) |
static int | l_set_background (lua_State *L) |
static int | l_update_formspec (lua_State *L) |
static int | l_set_formspec_prepend (lua_State *L) |
static int | l_get_screen_info (lua_State *L) |
static int | l_get_mainmenu_path (lua_State *L) |
static int | l_get_user_path (lua_State *L) |
static int | l_get_modpath (lua_State *L) |
static int | l_get_clientmodpath (lua_State *L) |
static int | l_get_gamepath (lua_State *L) |
static int | l_get_texturepath (lua_State *L) |
static int | l_get_texturepath_share (lua_State *L) |
static int | l_get_cache_path (lua_State *L) |
static int | l_get_temp_path (lua_State *L) |
static int | l_create_dir (lua_State *L) |
static int | l_delete_dir (lua_State *L) |
static int | l_copy_dir (lua_State *L) |
static int | l_is_dir (lua_State *L) |
static int | l_extract_zip (lua_State *L) |
static int | l_may_modify_path (lua_State *L) |
static int | l_download_file (lua_State *L) |
static int | l_get_video_drivers (lua_State *L) |
static int | l_get_video_modes (lua_State *L) |
static int | l_get_min_supp_proto (lua_State *L) |
static int | l_get_max_supp_proto (lua_State *L) |
static int | l_open_url (lua_State *L) |
static int | l_open_dir (lua_State *L) |
static int | l_do_async_callback (lua_State *L) |
Additional Inherited Members | |
Protected Member Functions inherited from LuaHelper | |
template<> | |
bool | readParam (lua_State *L, int index) |
Static Protected Member Functions inherited from LuaHelper | |
static bool | isNaN (lua_State *L, int idx) |
template<typename T > | |
static T | readParam (lua_State *L, int index) |
Read a value using a template type T from Lua State L and index. More... | |
template<typename T > | |
static T | readParam (lua_State *L, int index, const T &default_value) |
Read a value using a template type T from Lua State L and index. More... | |
Implementation of lua api support for mainmenu.
|
staticprivate |
read a bool variable from gamedata table within lua stack
L | stack to read variable from |
name | name of variable to read |
Referenced by l_start().
|
staticprivate |
read a integer variable from gamedata table within lua stack
L | stack to read variable from |
name | name of variable to read |
Referenced by l_start().
|
staticprivate |
read a text variable from gamedata table within lua stack
L | stack to read variable from |
name | name of variable to read |
Referenced by l_start().
|
static |
initialize this API module
L | lua stack to initialize |
top | index (in lua stack) of global API table |
References API_FCT, and porting::open_url().
Referenced by MainMenuScripting::initializeModApi().
|
static |
References API_FCT.
Referenced by MainMenuScripting::initializeModApi().
|
staticprivate |
References ModApiBase::getGuiEngine(), GUIEngine::m_kill, and sanity_check.
|
staticprivate |
References fs::CopyDir(), mayModifyPath(), fs::RecursiveDelete(), and fs::RemoveRelativePathComponents().
|
staticprivate |
|
staticprivate |
References DIR_DELIM, getAvailableGames(), loadGameConfAndInitWorld(), porting::path_user, sanitizeDirName(), and BaseException::what().
|
staticprivate |
References mayModifyPath(), fs::RecursiveDelete(), and fs::RemoveRelativePathComponents().
|
staticprivate |
References getAvailableWorlds(), WorldSpec::path, and fs::RecursiveDelete().
|
staticprivate |
References ModApiBase::getGuiEngine(), GUIEngine::queueAsync(), and sanity_check.
|
staticprivate |
References GUIEngine::downloadFile(), errorstream, mayModifyPath(), and fs::RemoveRelativePathComponents().
|
staticprivate |
References fs::CreateAllDirs(), DIR_DELIM, RenderingEngine::get_filesystem(), mayModifyPath(), fs::PathExists(), fs::RemoveLastPathComponent(), fs::RemoveRelativePathComponents(), and sanity_check.
|
staticprivate |
References porting::path_cache, and fs::RemoveRelativePathComponents().
|
staticprivate |
References DIR_DELIM, porting::path_user, and fs::RemoveRelativePathComponents().
|
staticprivate |
References ContentSpec::author, ModSpec::depends, ContentSpec::desc, ContentSpec::name, ModSpec::optdepends, parseContentInfo(), parseModContents(), ContentSpec::path, ModSpec::path, ContentSpec::release, and ContentSpec::type.
|
staticprivate |
References DIR_DELIM, porting::path_user, and fs::RemoveRelativePathComponents().
|
staticprivate |
|
staticprivate |
References ModApiBase::getGuiEngine(), GUIEngine::getScriptDir(), and sanity_check.
|
staticprivate |
|
staticprivate |
References CLIENT_PROTOCOL_VERSION_MAX.
|
staticprivate |
References CLIENT_PROTOCOL_VERSION_MIN.
|
staticprivate |
References DIR_DELIM, porting::path_user, and fs::RemoveRelativePathComponents().
|
staticprivate |
References RenderingEngine::get_instance(), RenderingEngine::getDisplayDensity(), RenderingEngine::getDisplaySize(), and RenderingEngine::getWindowSize().
|
staticprivate |
References ModApiBase::getGuiEngine(), GUIFormSpecMenu::getTable(), GUIEngine::m_menu, sanity_check, and table.
Referenced by l_get_textlist_index().
|
staticprivate |
|
staticprivate |
|
staticprivate |
References DIR_DELIM, porting::path_user, and fs::RemoveRelativePathComponents().
|
staticprivate |
References DIR_DELIM, porting::path_share, and fs::RemoveRelativePathComponents().
|
staticprivate |
References porting::path_user, and fs::RemoveRelativePathComponents().
|
staticprivate |
References RenderingEngine::getSupportedVideoDrivers(), RenderingEngine::getVideoDriverFriendlyName(), and RenderingEngine::getVideoDriverName().
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
|
staticprivate |
References mayModifyPath(), and fs::RemoveRelativePathComponents().
|
staticprivate |
|
staticprivate |
|
staticprivate |
References ModApiBase::getGuiEngine(), sanity_check, GUIEngine::setTexture(), TEX_LAYER_BACKGROUND, TEX_LAYER_FOOTER, TEX_LAYER_HEADER, and TEX_LAYER_OVERLAY.
|
staticprivate |
References ModApiBase::getGuiEngine(), GUIEngine::m_clouds_enabled, and sanity_check.
|
staticprivate |
References ModApiBase::getGuiEngine(), GUIEngine::m_startgame, sanity_check, and GUIEngine::setFormspecPrepend().
|
staticprivate |
References ModApiBase::getGuiEngine(), sanity_check, and GUIEngine::setTopleftText().
|
staticprivate |
References RenderingEngine::get_gui_env(), ModApiBase::getGuiEngine(), GUIEngine::m_menumanager, GUIEngine::m_parent, GUIEngine::m_texture_source, and sanity_check.
|
staticprivate |
References RenderingEngine::get_gui_env(), ModApiBase::getGuiEngine(), GUIEngine::m_buttonhandler, GUIEngine::m_menumanager, GUIEngine::m_parent, sanity_check, and GUIFileSelectMenu::setTextDest().
|
staticprivate |
References MainMenuData::address, MainMenuData::do_reconnect, getBoolData(), ModApiBase::getGuiEngine(), getIntegerData(), getTextData(), GUIEngine::m_data, GUIEngine::m_startgame, MainMenuData::name, MainMenuData::password, MainMenuData::port, sanity_check, MainMenuData::selected_world, MainMenuData::serverdescription, MainMenuData::servername, and MainMenuData::simple_singleplayer_mode.
|
staticprivate |
References ModApiBase::getGuiEngine(), GUIEngine::m_formspecgui, GUIEngine::m_startgame, sanity_check, and FormspecFormSource::setForm().
|
staticprivate |
Checks if a path may be modified.
Paths in the temp directory or the user games, mods, textures, or worlds directories may be modified.
path | path to check |
References DIR_DELIM, porting::path_cache, porting::path_user, fs::PathStartsWith(), fs::RemoveRelativePathComponents(), and fs::TempPath().
Referenced by l_copy_dir(), l_create_dir(), l_delete_dir(), l_download_file(), l_extract_zip(), and l_may_modify_path().