@@ -22,7 +22,6 @@ mt_color_dark_green = "#25C191"
22
22
23
23
local menupath = core .get_mainmenu_path ()
24
24
local basepath = core .get_builtin_path ()
25
- local menustyle = core .settings :get (" main_menu_style" )
26
25
defaulttexturedir = core .get_texturepath_share () .. DIR_DELIM .. " base" ..
27
26
DIR_DELIM .. " pack" .. DIR_DELIM
28
27
@@ -39,24 +38,18 @@ dofile(menupath .. DIR_DELIM .. "textures.lua")
39
38
dofile (menupath .. DIR_DELIM .. " dlg_config_world.lua" )
40
39
dofile (menupath .. DIR_DELIM .. " dlg_settings_advanced.lua" )
41
40
dofile (menupath .. DIR_DELIM .. " dlg_contentstore.lua" )
42
- if menustyle ~= " simple" then
43
- dofile (menupath .. DIR_DELIM .. " dlg_create_world.lua" )
44
- dofile (menupath .. DIR_DELIM .. " dlg_delete_content.lua" )
45
- dofile (menupath .. DIR_DELIM .. " dlg_delete_world.lua" )
46
- dofile (menupath .. DIR_DELIM .. " dlg_rename_modpack.lua" )
47
- end
41
+ dofile (menupath .. DIR_DELIM .. " dlg_create_world.lua" )
42
+ dofile (menupath .. DIR_DELIM .. " dlg_delete_content.lua" )
43
+ dofile (menupath .. DIR_DELIM .. " dlg_delete_world.lua" )
44
+ dofile (menupath .. DIR_DELIM .. " dlg_rename_modpack.lua" )
48
45
49
46
local tabs = {}
50
47
51
48
tabs .settings = dofile (menupath .. DIR_DELIM .. " tab_settings.lua" )
52
49
tabs .content = dofile (menupath .. DIR_DELIM .. " tab_content.lua" )
53
50
tabs .credits = dofile (menupath .. DIR_DELIM .. " tab_credits.lua" )
54
- if menustyle == " simple" then
55
- tabs .simple_main = dofile (menupath .. DIR_DELIM .. " tab_simple_main.lua" )
56
- else
57
- tabs .local_game = dofile (menupath .. DIR_DELIM .. " tab_local.lua" )
58
- tabs .play_online = dofile (menupath .. DIR_DELIM .. " tab_online.lua" )
59
- end
51
+ tabs .local_game = dofile (menupath .. DIR_DELIM .. " tab_local.lua" )
52
+ tabs .play_online = dofile (menupath .. DIR_DELIM .. " tab_online.lua" )
60
53
61
54
---- ----------------------------------------------------------------------------
62
55
local function main_event_handler (tabview , event )
@@ -71,68 +64,35 @@ local function init_globals()
71
64
-- Init gamedata
72
65
gamedata .worldindex = 0
73
66
74
- if menustyle == " simple" then
75
- local world_list = core .get_worlds ()
76
- local world_index
77
-
78
- local found_singleplayerworld = false
79
- for i , world in ipairs (world_list ) do
80
- if world .name == " singleplayerworld" then
81
- found_singleplayerworld = true
82
- world_index = i
83
- break
84
- end
85
- end
86
-
87
- if not found_singleplayerworld then
88
- core .create_world (" singleplayerworld" , 1 )
89
-
90
- world_list = core .get_worlds ()
91
-
92
- for i , world in ipairs (world_list ) do
93
- if world .name == " singleplayerworld" then
94
- world_index = i
95
- break
96
- end
97
- end
67
+ menudata .worldlist = filterlist .create (
68
+ core .get_worlds ,
69
+ compare_worlds ,
70
+ -- Unique id comparison function
71
+ function (element , uid )
72
+ return element .name == uid
73
+ end ,
74
+ -- Filter function
75
+ function (element , gameid )
76
+ return element .gameid == gameid
98
77
end
78
+ )
99
79
100
- gamedata .worldindex = world_index
101
- else
102
- menudata .worldlist = filterlist .create (
103
- core .get_worlds ,
104
- compare_worlds ,
105
- -- Unique id comparison function
106
- function (element , uid )
107
- return element .name == uid
108
- end ,
109
- -- Filter function
110
- function (element , gameid )
111
- return element .gameid == gameid
112
- end
113
- )
114
-
115
- menudata .worldlist :add_sort_mechanism (" alphabetic" , sort_worlds_alphabetic )
116
- menudata .worldlist :set_sortmode (" alphabetic" )
117
-
118
- if not core .settings :get (" menu_last_game" ) then
119
- local default_game = core .settings :get (" default_game" ) or " minetest"
120
- core .settings :set (" menu_last_game" , default_game )
121
- end
80
+ menudata .worldlist :add_sort_mechanism (" alphabetic" , sort_worlds_alphabetic )
81
+ menudata .worldlist :set_sortmode (" alphabetic" )
122
82
123
- mm_texture .init ()
83
+ if not core .settings :get (" menu_last_game" ) then
84
+ local default_game = core .settings :get (" default_game" ) or " minetest"
85
+ core .settings :set (" menu_last_game" , default_game )
124
86
end
125
87
88
+ mm_texture .init ()
89
+
126
90
-- Create main tabview
127
91
local tv_main = tabview_create (" maintab" , {x = 12 , y = 5.4 }, {x = 0 , y = 0 })
128
92
129
- if menustyle == " simple" then
130
- tv_main :add (tabs .simple_main )
131
- else
132
- tv_main :set_autosave_tab (true )
133
- tv_main :add (tabs .local_game )
134
- tv_main :add (tabs .play_online )
135
- end
93
+ tv_main :set_autosave_tab (true )
94
+ tv_main :add (tabs .local_game )
95
+ tv_main :add (tabs .play_online )
136
96
137
97
tv_main :add (tabs .content )
138
98
tv_main :add (tabs .settings )
@@ -141,11 +101,9 @@ local function init_globals()
141
101
tv_main :set_global_event_handler (main_event_handler )
142
102
tv_main :set_fixed_size (false )
143
103
144
- if menustyle ~= " simple" then
145
- local last_tab = core .settings :get (" maintab_LAST" )
146
- if last_tab and tv_main .current_tab ~= last_tab then
147
- tv_main :set_tab (last_tab )
148
- end
104
+ local last_tab = core .settings :get (" maintab_LAST" )
105
+ if last_tab and tv_main .current_tab ~= last_tab then
106
+ tv_main :set_tab (last_tab )
149
107
end
150
108
ui .set_default (" maintab" )
151
109
tv_main :show ()
0 commit comments