File tree 3 files changed +9
-10
lines changed
3 files changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -37,9 +37,9 @@ dofile(commonpath .. "misc_helpers.lua")
37
37
if INIT == " game" then
38
38
dofile (gamepath .. " init.lua" )
39
39
elseif INIT == " mainmenu" then
40
- local mainmenuscript = core .setting_get (" main_menu_script" )
41
- if mainmenuscript ~= nil and mainmenuscript ~= " " then
42
- dofile (mainmenuscript )
40
+ local mm_script = core .setting_get (" main_menu_script" )
41
+ if mm_script and mm_script ~= " " then
42
+ dofile (mm_script )
43
43
else
44
44
dofile (core .get_mainmenu_path () .. DIR_DELIM .. " init.lua" )
45
45
end
@@ -48,4 +48,3 @@ elseif INIT == "async" then
48
48
else
49
49
error ((" Unrecognized builtin initialization type %s!" ):format (tostring (INIT )))
50
50
end
51
-
Original file line number Diff line number Diff line change 667
667
-- The documentation of mapgen noise parameter formats (title plus 16 lines)
668
668
-- Noise parameter 'mgv5_np_ground' in group format (13 lines)
669
669
670
- -- assert(loadfile(core.get_mainmenu_path() ..DIR_DELIM.."generate_from_settingtypes.lua"))(parse_config_file(true, false))
670
+ -- assert(loadfile(core.get_builtin_path()..DIR_DELIM.."mainmenu" ..DIR_DELIM.."generate_from_settingtypes.lua"))(parse_config_file(true, false))
Original file line number Diff line number Diff line change @@ -213,13 +213,13 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
213
213
m_data->script_data .errormessage = " " ;
214
214
215
215
if (!loadMainMenuScript ()) {
216
- errorstream << " No future without mainmenu " << std::endl;
216
+ errorstream << " No future without main menu! " << std::endl;
217
217
abort ();
218
218
}
219
219
220
220
run ();
221
221
} catch (LuaError &e) {
222
- errorstream << " MAINMENU ERROR : " << e.what () << std::endl;
222
+ errorstream << " Main menu error : " << e.what () << std::endl;
223
223
m_data->script_data .errormessage = e.what ();
224
224
}
225
225
@@ -231,13 +231,13 @@ GUIEngine::GUIEngine( irr::IrrlichtDevice* dev,
231
231
/* *****************************************************************************/
232
232
bool GUIEngine::loadMainMenuScript ()
233
233
{
234
- // Try custom menu script (main_menu_path)
235
-
234
+ // Set main menu path (for core.get_mainmenu_path())
236
235
m_scriptdir = g_settings->get (" main_menu_path" );
237
236
if (m_scriptdir.empty ()) {
238
- m_scriptdir = porting::path_share + DIR_DELIM " builtin" + DIR_DELIM " mainmenu" ;
237
+ m_scriptdir = porting::path_share + DIR_DELIM + " builtin" + DIR_DELIM + " mainmenu" ;
239
238
}
240
239
240
+ // Load builtin (which will load the main menu script)
241
241
std::string script = porting::path_share + DIR_DELIM " builtin" + DIR_DELIM " init.lua" ;
242
242
try {
243
243
m_script->loadScript (script);
You can’t perform that action at this time.
0 commit comments