aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api
diff options
context:
space:
mode:
Diffstat (limited to 'src/script/lua_api')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp16
-rw-r--r--src/script/lua_api/l_mainmenu.h2
2 files changed, 18 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index 2094da241..76db7ed13 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -107,6 +107,21 @@ int ModApiMainMenu::l_update_formspec(lua_State *L)
}
/******************************************************************************/
+int ModApiMainMenu::l_set_formspec_prepend(lua_State *L)
+{
+ GUIEngine *engine = getGuiEngine(L);
+ sanity_check(engine != NULL);
+
+ if (engine->m_startgame)
+ return 0;
+
+ std::string formspec(luaL_checkstring(L, 1));
+ engine->setFormspecPrepend(formspec);
+
+ return 0;
+}
+
+/******************************************************************************/
int ModApiMainMenu::l_start(lua_State *L)
{
GUIEngine* engine = getGuiEngine(L);
@@ -1041,6 +1056,7 @@ int ModApiMainMenu::l_do_async_callback(lua_State *L)
void ModApiMainMenu::Initialize(lua_State *L, int top)
{
API_FCT(update_formspec);
+ API_FCT(set_formspec_prepend);
API_FCT(set_clouds);
API_FCT(get_textlist_index);
API_FCT(get_table_index);
diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h
index 9ff822960..b2ca49320 100644
--- a/src/script/lua_api/l_mainmenu.h
+++ b/src/script/lua_api/l_mainmenu.h
@@ -104,6 +104,8 @@ private:
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);
//filesystem