Newer
Older
"Perttu Ahola (celeron55) <celeron55@gmail.com>,"..
"Ryan Kwolek (kwolekr) <kwolekr@minetest.net>,"..
"PilzAdam <pilzadam@minetest.net>," ..
"Lisa Milne (darkrose) <lisa@ltmnet.com>,"..
"Maciej Kasatkin (RealBadAngel) <mk@realbadangel.pl>,"..
"proller <proler@gmail.com>,"..
"sfan5 <sfan5@live.de>,"..
"kahrl <kahrl@gmx.net>,"..
"sapier,"..
"ShadowNinja <shadowninja@minetest.net>,"..
"Nathanaël Courant (Nore/Novatux) <nore@mesecons.net>,"..
"#FFFF00" .. fgettext("Active Contributors") .. "," ..
"Vanessa Ezekowitz (VanessaE) <vanessaezekowitz@gmail.com>,"..
"Jurgen Doser (doserj) <jurgen.doser@gmail.com>,"..
"Jeija <jeija@mesecons.net>,"..
"MirceaKitsune <mirceakitsune@gmail.com>,"..
"dannydark <the_skeleton_of_a_child@yahoo.co.uk>,"..
"0gb.us <0gb.us@0gb.us>,"..
"," ..
"#FFFF00" .. fgettext("Previous Contributors") .. "," ..
"Guiseppe Bilotta (Oblomov) <guiseppe.bilotta@gmail.com>,"..
"Jonathan Neuschafer <j.neuschaefer@gmx.net>,"..
"Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net>,"..
"Constantin Wenger (SpeedProg) <constantin.wenger@googlemail.com>,"..
"matttpt <matttpt@gmail.com>,"..
"JacobF <queatz@gmail.com>,"..
";0;true]"
end
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
--------------------------------------------------------------------------------
function tabbuilder.init()
tabbuilder.tabfuncs = {
singleplayer = tabbuilder.tab_singleplayer,
multiplayer = tabbuilder.tab_multiplayer,
server = tabbuilder.tab_server,
settings = tabbuilder.tab_settings,
texture_packs = tabbuilder.tab_texture_packs,
credits = tabbuilder.tab_credits,
dialog_create_world = tabbuilder.dialog_create_world,
dialog_delete_world = tabbuilder.dialog_delete_world
}
tabbuilder.tabsizes = {
dialog_create_world = {width=12, height=7},
dialog_delete_world = {width=12, height=5.2}
}
tabbuilder.current_tab = engine.setting_get("main_menu_tab")
if tabbuilder.current_tab == nil or
tabbuilder.current_tab == "" then
tabbuilder.current_tab = "singleplayer"
engine.setting_set("main_menu_tab",tabbuilder.current_tab)
end
--initialize tab buttons
tabbuilder.last_tab = nil
tabbuilder.show_buttons = true
tabbuilder.current_buttons = {}
table.insert(tabbuilder.current_buttons,{name="singleplayer", caption=fgettext("Singleplayer")})
table.insert(tabbuilder.current_buttons,{name="multiplayer", caption=fgettext("Client")})
table.insert(tabbuilder.current_buttons,{name="server", caption=fgettext("Server")})
table.insert(tabbuilder.current_buttons,{name="settings", caption=fgettext("Settings")})
table.insert(tabbuilder.current_buttons,{name="texture_packs", caption=fgettext("Texture Packs")})
if engine.setting_getbool("main_menu_game_mgr") then
table.insert(tabbuilder.current_buttons,{name="game_mgr", caption=fgettext("Games")})
end
if engine.setting_getbool("main_menu_mod_mgr") then
table.insert(tabbuilder.current_buttons,{name="mod_mgr", caption=fgettext("Mods")})
end
table.insert(tabbuilder.current_buttons,{name="credits", caption=fgettext("Credits")})
for i=1,#tabbuilder.current_buttons,1 do
if tabbuilder.current_buttons[i].name == tabbuilder.current_tab then
tabbuilder.last_tab_index = i
end
end
if tabbuilder.current_tab ~= "singleplayer" then
menu.update_gametype(true)
else
menu.update_gametype()
end
end
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
--------------------------------------------------------------------------------
function tabbuilder.checkretval(retval)
if retval ~= nil then
if retval.current_tab ~= nil then
tabbuilder.current_tab = retval.current_tab
end
if retval.is_dialog ~= nil then
tabbuilder.is_dialog = retval.is_dialog
end
if retval.show_buttons ~= nil then
tabbuilder.show_buttons = retval.show_buttons
end
if retval.skipformupdate ~= nil then
tabbuilder.skipformupdate = retval.skipformupdate
end
end
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- initialize callbacks
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
engine.button_handler = function(fields)
--print("Buttonhandler: tab: " .. tabbuilder.current_tab .. " fields: " .. dump(fields))
if fields["btn_error_confirm"] then
gamedata.errormessage = nil
end
local retval = modmgr.handle_buttons(tabbuilder.current_tab,fields)
tabbuilder.checkretval(retval)
retval = gamemgr.handle_buttons(tabbuilder.current_tab,fields)
tabbuilder.checkretval(retval)
retval = modstore.handle_buttons(tabbuilder.current_tab,fields)
tabbuilder.checkretval(retval)
if tabbuilder.current_tab == "dialog_create_world" then
tabbuilder.handle_create_world_buttons(fields)
end
if tabbuilder.current_tab == "dialog_delete_world" then
tabbuilder.handle_delete_world_buttons(fields)
end
if tabbuilder.current_tab == "singleplayer" then
tabbuilder.handle_singleplayer_buttons(fields)
end
if tabbuilder.current_tab == "texture_packs" then
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
if tabbuilder.current_tab == "multiplayer" then
tabbuilder.handle_multiplayer_buttons(fields)
end
if tabbuilder.current_tab == "settings" then
tabbuilder.handle_settings_buttons(fields)
end
if tabbuilder.current_tab == "server" then
tabbuilder.handle_server_buttons(fields)
end
--tab buttons
tabbuilder.handle_tab_buttons(fields)
--menubar buttons
menubar.handle_buttons(fields)
if not tabbuilder.skipformupdate then
--update menu
update_menu()
else
tabbuilder.skipformupdate = false
end
end
--------------------------------------------------------------------------------
engine.event_handler = function(event)
if event == "MenuQuit" then
if tabbuilder.is_dialog then
tabbuilder.is_dialog = false
tabbuilder.show_buttons = true
tabbuilder.current_tab = engine.setting_get("main_menu_tab")
update_menu()
else
engine.close()
end
end
end
--------------------------------------------------------------------------------
function menu.update_gametype(reset)
if reset then
mm_texture.reset()
engine.set_topleft_text("")
filterlist.set_filtercriteria(worldlist,nil)
else
local game = menu.lastgame()
mm_texture.update(tabbuilder.current_tab,game)
engine.set_topleft_text(game.name)
filterlist.set_filtercriteria(worldlist,game.id)
end
end
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
-- menu startup
--------------------------------------------------------------------------------
--------------------------------------------------------------------------------
init_globals()
menu.init()
tabbuilder.init()
menubar.refresh()
modstore.init()