core.explode_textlist_event(string) -> table
^ returns e.g. {type="CHG", index=1}
^ type: "INV" (no row selected), "CHG" (selected) or "DCL" (double-click)
+core.set_formspec_prepend(formspec)
+^ string to be added to every mainmenu formspec, to be used for theming.
GUI:
core.set_background(type, texturepath,[tile],[minsize])
}
}
+/******************************************************************************/
+void GUIEngine::setFormspecPrepend(const std::string &fs)
+{
+ if (m_menu) {
+ m_menu->setFormspecPrepend(fs);
+ }
+}
+
+
/******************************************************************************/
void GUIEngine::drawBackground(video::IVideoDriver *driver)
{
{
return m_script->queueAsync(serialized_func, serialized_params);
}
-
/** script basefolder */
std::string m_scriptdir = "";
+ void setFormspecPrepend(const std::string &fs);
+
/**
* draw background layer
* @param driver to use for drawing
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)
{
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);
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