Newer
Older
dump(engine.setting_getbool("creative_mode")) .. "]"..
"checkbox[0.5,0.7;cb_enable_damage;".. fgettext("Enable Damage") .. ";" ..
dump(engine.setting_getbool("enable_damage")) .. "]"..
"textlist[4,0.25;7.5,3.7;sp_worlds;" ..
";" .. index .. "]" ..
menubar.formspec
end
--------------------------------------------------------------------------------
function tabbuilder.tab_texture_packs()
local retval = "label[4,-0.25;".. fgettext("Select texture pack:") .. "]"..
"vertlabel[0,-0.25;".. fgettext("TEXTURE PACKS") .. "]" ..
"textlist[4,0.25;7.5,5.0;TPs;"
local current_texture_path = engine.setting_get("texture_path")
local list = filter_texture_pack_list(engine.get_dirlist(engine.get_texturepath(), true))
local index = tonumber(engine.setting_get("mainmenu_last_selected_TP"))
if index == nil then index = 1 end
if current_texture_path == "" then
retval = retval ..
menu.render_texture_pack_list(list) ..
local infofile = current_texture_path ..DIR_DELIM.."info.txt"
local infotext = ""
local f = io.open(infofile, "r")
local screenfile = current_texture_path..DIR_DELIM.."screenshot.png"
local no_screenshot = nil
if not file_exists(screenfile) then
screenfile = nil
no_screenshot = engine.get_texturepath()..DIR_DELIM..
"base"..DIR_DELIM.."pack"..DIR_DELIM.."no_screenshot.png"
end
return retval ..
menu.render_texture_pack_list(list) ..
"image[0.65,0.25;4.0,3.7;"..engine.formspec_escape(screenfile or no_screenshot).."]"..
"textarea[1.0,3.25;3.7,1.5;;"..engine.formspec_escape(infotext or "")..";]"
--------------------------------------------------------------------------------
function tabbuilder.tab_credits()
local logofile = menu.defaulttexturedir .. "logo.png"
return "vertlabel[0,-0.5;CREDITS]" ..
"label[0.5,3;Minetest " .. engine.get_version() .. "]" ..
"label[0.5,3.3;http://minetest.net]" ..
"image[0.5,1;" .. engine.formspec_escape(logofile) .. "]" ..
"textlist[3.5,-0.25;8.5,5.8;list_credits;" ..
"#FFFF00" .. fgettext("Core Developers") .."," ..
"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>,"..
","..
"#FFFF00" .. fgettext("Active Contributors") .. "," ..
"sapier,"..
"Vanessa Ezekowitz (VanessaE) <vanessaezekowitz@gmail.com>,"..
"Jurgen Doser (doserj) <jurgen.doser@gmail.com>,"..
"Jeija <jeija@mesecons.net>,"..
"MirceaKitsune <mirceakitsune@gmail.com>,"..
"ShadowNinja,"..
"dannydark <the_skeleton_of_a_child@yahoo.co.uk>,"..
"0gb.us <0gb.us@0gb.us>,"..
"," ..
"#FFFF00" .. fgettext("Previous Contributors") .. "," ..
1084
1085
1086
1087
1088
1089
1090
1091
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
1147
"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
--------------------------------------------------------------------------------
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
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
1184
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()