aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShadowNinja <shadowninja@minetest.net>2015-10-15 13:05:33 -0400
committerShadowNinja <shadowninja@minetest.net>2017-01-13 18:13:43 -0500
commitbb154c2e1cf185f181c3e85df9addb79e6d18b4c (patch)
tree6b7f73967b0b1888943631b73ee939583d548e77
parentef0aa7d5b543b6561e1b7292b2d0a0ac43add55d (diff)
downloadminetest-bb154c2e1cf185f181c3e85df9addb79e6d18b4c.tar.gz
minetest-bb154c2e1cf185f181c3e85df9addb79e6d18b4c.tar.bz2
minetest-bb154c2e1cf185f181c3e85df9addb79e6d18b4c.zip
Main menu tweaks
-rw-r--r--builtin/init.lua7
-rw-r--r--builtin/mainmenu/dlg_settings_advanced.lua2
-rw-r--r--src/guiEngine.cpp10
3 files changed, 9 insertions, 10 deletions
diff --git a/builtin/init.lua b/builtin/init.lua
index 4400a19d6..b34ad14a0 100644
--- a/builtin/init.lua
+++ b/builtin/init.lua
@@ -37,9 +37,9 @@ dofile(commonpath .. "misc_helpers.lua")
if INIT == "game" then
dofile(gamepath .. "init.lua")
elseif INIT == "mainmenu" then
- local mainmenuscript = core.setting_get("main_menu_script")
- if mainmenuscript ~= nil and mainmenuscript ~= "" then
- dofile(mainmenuscript)
+ local mm_script = core.setting_get("main_menu_script")
+ if mm_script and mm_script ~= "" then
+ dofile(mm_script)
else
dofile(core.get_mainmenu_path() .. DIR_DELIM .. "init.lua")
end
@@ -48,4 +48,3 @@ elseif INIT == "async" then
else
error(("Unrecognized builtin initialization type %s!"):format(tostring(INIT)))
end
-
diff --git a/builtin/mainmenu/dlg_settings_advanced.lua b/builtin/mainmenu/dlg_settings_advanced.lua
index 85218c852..60ec1250f 100644
--- a/builtin/mainmenu/dlg_settings_advanced.lua
+++ b/builtin/mainmenu/dlg_settings_advanced.lua
@@ -667,4 +667,4 @@ end
-- The documentation of mapgen noise parameter formats (title plus 16 lines)
-- Noise parameter 'mgv5_np_ground' in group format (13 lines)
---assert(loadfile(core.get_mainmenu_path()..DIR_DELIM.."generate_from_settingtypes.lua"))(parse_config_file(true, false))
+--assert(loadfile(core.get_builtin_path()..DIR_DELIM.."mainmenu"..DIR_DELIM.."generate_from_settingtypes.lua"))(parse_config_file(true, false))
diff --git a/src/guiEngine.cpp b/src/guiEngine.cpp
index 6d66ed08d..03fee6b96 100644
--- a/src/guiEngine.cpp
+++ b/src/guiEngine.cpp
@@ -213,13 +213,13 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
m_data->script_data.errormessage = "";
if (!loadMainMenuScript()) {
- errorstream << "No future without mainmenu" << std::endl;
+ errorstream << "No future without main menu!" << std::endl;
abort();
}
run();
} catch (LuaError &e) {
- errorstream << "MAINMENU ERROR: " << e.what() << std::endl;
+ errorstream << "Main menu error: " << e.what() << std::endl;
m_data->script_data.errormessage = e.what();
}
@@ -231,13 +231,13 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
/******************************************************************************/
bool GUIEngine::loadMainMenuScript()
{
- // Try custom menu script (main_menu_path)
-
+ // Set main menu path (for core.get_mainmenu_path())
m_scriptdir = g_settings->get("main_menu_path");
if (m_scriptdir.empty()) {
- m_scriptdir = porting::path_share + DIR_DELIM "builtin" + DIR_DELIM "mainmenu";
+ m_scriptdir = porting::path_share + DIR_DELIM + "builtin" + DIR_DELIM + "mainmenu";
}
+ // Load builtin (which will load the main menu script)
std::string script = porting::path_share + DIR_DELIM "builtin" + DIR_DELIM "init.lua";
try {
m_script->loadScript(script);