1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Add support for set_formspec_prepend in main menu (#8611)

This commit is contained in:
rubenwardy 2019-08-12 18:16:35 +01:00 committed by sfan5
parent a067d40454
commit 91114b562f
5 changed files with 31 additions and 1 deletions

View file

@ -106,6 +106,21 @@ int ModApiMainMenu::l_update_formspec(lua_State *L)
return 0;
}
/******************************************************************************/
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)
{
@ -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);