Mainmenu: some improvements
|
@ -25,7 +25,7 @@ mt_color_dark_green = "#25C191"
|
|||
local menupath = core.get_mainmenu_path()
|
||||
local basepath = core.get_builtin_path()
|
||||
defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" .. DIR_DELIM
|
||||
local use_simple_menu = (PLATFORM == "Android" or PLATFORM == "iOS")
|
||||
local mobile = (PLATFORM == "Android" or PLATFORM == "iOS")
|
||||
|
||||
dofile(basepath .. DIR_DELIM .. "common" .. DIR_DELIM .. "async_event.lua")
|
||||
dofile(basepath .. DIR_DELIM .. "common" .. DIR_DELIM .. "filterlist.lua")
|
||||
|
@ -34,17 +34,17 @@ dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "tabview.lua")
|
|||
dofile(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "ui.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "common.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "gamemgr.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "textures.lua")
|
||||
--dofile(menupath .. DIR_DELIM .. "textures.lua")
|
||||
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_create_world.lua")
|
||||
--dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
|
||||
--dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
|
||||
--dofile(menupath .. DIR_DELIM .. "dlg_config_world.lua")
|
||||
|
||||
if not use_simple_menu then
|
||||
if not mobile then
|
||||
dofile(menupath .. DIR_DELIM .. "modmgr.lua")
|
||||
-- dofile(menupath .. DIR_DELIM .. "store.lua")
|
||||
--dofile(menupath .. DIR_DELIM .. "store.lua")
|
||||
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
|
||||
end
|
||||
|
||||
|
@ -55,9 +55,10 @@ tabs.credits = dofile(menupath .. DIR_DELIM .. "tab_credits.lua")
|
|||
tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
|
||||
tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua")
|
||||
--tabs.server = dofile(menupath .. DIR_DELIM .. "tab_server.lua")
|
||||
if not use_simple_menu then
|
||||
|
||||
if not mobile then
|
||||
tabs.settings = dofile(menupath .. DIR_DELIM .. "tab_settings.lua")
|
||||
tabs.texturepacks = dofile(menupath .. DIR_DELIM .. "tab_texturepacks.lua")
|
||||
-- tabs.texturepacks = dofile(menupath .. DIR_DELIM .. "tab_texturepacks.lua")
|
||||
end
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
@ -89,20 +90,20 @@ local function init_globals()
|
|||
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
|
||||
menudata.worldlist:set_sortmode("alphabetic")
|
||||
|
||||
mm_texture.init()
|
||||
-- mm_texture.init()
|
||||
|
||||
-- Create main tabview
|
||||
local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0})
|
||||
|
||||
tv_main:add(tabs.local_game)
|
||||
tv_main:add(tabs.play_online)
|
||||
|
||||
if not mobile then
|
||||
tv_main:add(tabs.settings)
|
||||
-- tv_main:add(tabs.texturepacks)
|
||||
end
|
||||
|
||||
if not use_simple_menu then
|
||||
tv_main:add(tabs.settings)
|
||||
tv_main:add(tabs.texturepacks)
|
||||
end
|
||||
|
||||
--tv_main:add(tabs.mods)
|
||||
-- tv_main:add(tabs.mods)
|
||||
tv_main:add(tabs.credits)
|
||||
|
||||
tv_main:set_autosave_tab(true)
|
||||
|
@ -117,16 +118,13 @@ local function init_globals()
|
|||
tv_main:show()
|
||||
|
||||
-- Create modstore ui
|
||||
--if use_simple_menu then
|
||||
-- modstore.init({x = 12, y = 6}, 3, 2)
|
||||
--else
|
||||
-- modstore.init({x = 12, y = 8}, 4, 3)
|
||||
--end
|
||||
-- modstore.init({x = 12, y = 5.4}, 3, 2)
|
||||
|
||||
ui.update()
|
||||
|
||||
minetest.set_clouds(false)
|
||||
mm_texture.set_dirt_bg()
|
||||
core.set_clouds(false)
|
||||
-- mm_texture.set_dirt_bg()
|
||||
core.set_background("background", defaulttexturedir .. "bg.png", true, 256)
|
||||
end
|
||||
|
||||
init_globals()
|
||||
|
|
|
@ -24,7 +24,7 @@ local multicraft_developers = {
|
|||
"sfan5 <sfan5@live.de>",
|
||||
"Stuart Jones (stujones11) <stujones111@gmail.com>",
|
||||
"Jean-Patrick Guerrero (kilbith) <jeanpatrick.guerrero@gmail.com>",
|
||||
"And other people who helped make the world better!",
|
||||
"And other people who helped make the world better!"
|
||||
}
|
||||
|
||||
local core_developers = {
|
||||
|
@ -37,7 +37,7 @@ local core_developers = {
|
|||
"Craig Robbins (Zeno) <craig.d.robbins@gmail.com>",
|
||||
"Auke Kok (sofar) <sofar@foo-projects.org>",
|
||||
"rubenwardy <rw@rubenwardy.com>",
|
||||
"Krock/SmallJoker <mk939@ymail.com>",
|
||||
"Krock/SmallJoker <mk939@ymail.com>"
|
||||
}
|
||||
|
||||
local active_contributors = {
|
||||
|
@ -50,7 +50,7 @@ local active_contributors = {
|
|||
"bigfoot547 [CSM]",
|
||||
"Rogier <rogier777@gmail.com> [Fixes]",
|
||||
"Wuzzy [Audiovisuals]",
|
||||
"Shara/Ezhh [Settings]",
|
||||
"Shara/Ezhh [Settings]"
|
||||
}
|
||||
|
||||
local previous_core_developers = {
|
||||
|
@ -63,7 +63,7 @@ local previous_core_developers = {
|
|||
"est31 <MTest31@outlook.com>",
|
||||
"kahrl <kahrl@gmx.net>",
|
||||
"Ryan Kwolek (kwolekr) <kwolekr@minetest.net>",
|
||||
"sapier",
|
||||
"sapier"
|
||||
}
|
||||
|
||||
local previous_contributors = {
|
||||
|
@ -80,7 +80,7 @@ local previous_contributors = {
|
|||
"Guiseppe Bilotta (Oblomov) <guiseppe.bilotta@gmail.com> [Fixes]",
|
||||
"matttpt <matttpt@gmail.com> [Fixes]",
|
||||
"Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net> [Minetest Logo]",
|
||||
"Jeija <jeija@mesecons.net> [HTTP, particles]",
|
||||
"Jeija <jeija@mesecons.net> [HTTP, particles]"
|
||||
}
|
||||
|
||||
local function buildCreditList(source)
|
||||
|
|
|
@ -27,7 +27,7 @@ local function get_formspec()
|
|||
core.formspec_escape(defaulttexturedir ..
|
||||
"blank.png") .. ";world_create;;true;false]"
|
||||
|
||||
local creative_checkbox = core.settings:get_bool("creative_mode") and "local_creative_checkbox.png" or "blank.png"
|
||||
local creative_checkbox = core.settings:get_bool("creative_mode") and "local_creative_checkbox" or "blank"
|
||||
retval = retval ..
|
||||
"image_button[6.72,1.43;4.96,1.41;" ..
|
||||
core.formspec_escape(defaulttexturedir ..
|
||||
|
@ -35,7 +35,7 @@ local function get_formspec()
|
|||
"image_button[7.33,3.09;3.73,0.86;" ..
|
||||
core.formspec_escape(defaulttexturedir ..
|
||||
creative_checkbox) ..
|
||||
";cb_creative_mode;;true;false]" ..
|
||||
".png;cb_creative_mode;;true;false]" ..
|
||||
"textlist[-0.01,0;6.28,4.64;sp_worlds;" ..
|
||||
menu_render_worldlist() ..
|
||||
";" .. index .. ";true]"
|
||||
|
@ -184,5 +184,5 @@ return {
|
|||
name = "local",
|
||||
caption = fgettext("Singleplayer"),
|
||||
cbf_formspec = get_formspec,
|
||||
cbf_button_handler = main_button_handler,
|
||||
cbf_button_handler = main_button_handler
|
||||
}
|
||||
|
|
|
@ -35,40 +35,46 @@ local function get_formspec(_, _, tabdata)
|
|||
|
||||
local retval =
|
||||
-- Search
|
||||
"field[0.2,0.1;5.71,1;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
|
||||
"image_button[5.52,-0.13;0.83,0.83;" .. core.formspec_escape(defaulttexturedir .. "search.png")
|
||||
.. ";btn_mp_search;" .. "]" ..
|
||||
"field[0.2,0.1;5.8,1;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" ..
|
||||
"image_button[5.5,-0.13;0.83,0.83;" .. core.formspec_escape(defaulttexturedir .. "search.png")
|
||||
.. ";btn_mp_search;;true;false]" ..
|
||||
"image_button[6.26,-0.13;0.83,0.83;" .. core.formspec_escape(defaulttexturedir .. "refresh.png")
|
||||
.. ";btn_mp_refresh;;;true]" ..
|
||||
.. ";btn_mp_refresh;;true;false]" ..
|
||||
|
||||
-- Address / Port
|
||||
"field[7.4,0.5;3.2,0.5;te_address;" .. fgettext("Address:") .. ";" ..
|
||||
"label[7.1,-0.3;" .. fgettext("Address:") .. "]" ..
|
||||
"label[10.15,-0.3;" .. fgettext("Port:") .. "]" ..
|
||||
"field[7.4,0.6;3.2,0.5;te_address;;" ..
|
||||
core.formspec_escape(core.settings:get("address")) .. "]" ..
|
||||
"field[10.5,0.5;1.85,0.5;te_port;" .. fgettext("Port:") .. ";" ..
|
||||
"field[10.45,0.6;1.9,0.5;te_port;;" ..
|
||||
core.formspec_escape(core.settings:get("remote_port")) .. "]" ..
|
||||
|
||||
-- Password
|
||||
"field[7.4,1.6;3.2,0.5;te_name;" .. fgettext("Name:") .. ";" ..
|
||||
-- Name
|
||||
"label[7.1,0.85;" .. fgettext("Name:") .. "]" ..
|
||||
"label[10.15,0.85;" .. fgettext("Password:") .. "]" ..
|
||||
"field[7.4,1.75;3.2,0.5;te_name;;" ..
|
||||
core.formspec_escape(core.settings:get("name")) .. "]" ..
|
||||
|
||||
-- Description Background
|
||||
"box[7.1,2;4.8,2.75;#999999]"..
|
||||
"box[7.1,2.1;4.8,2.65;#999999]"..
|
||||
|
||||
-- Connect
|
||||
"button[9.4,5.045;2.7,0.505;btn_mp_connect;" .. fgettext("Connect") .. "]"
|
||||
|
||||
"image_button[8.8,4.88;3.3,0.9;" ..
|
||||
core.formspec_escape(defaulttexturedir ..
|
||||
"blank.png") .. ";btn_mp_connect;;true;false]"
|
||||
|
||||
-- Password
|
||||
if password_save then
|
||||
retval = retval .. "pwdfield[10.5,1.65;1.86,0.39;te_pwd;" .. fgettext("Password:") .. ";" ..
|
||||
retval = retval .. "pwdfield[10.45,1.81;1.91,0.39;te_pwd;;" ..
|
||||
core.formspec_escape(core.settings:get("password")) .. "]"
|
||||
else
|
||||
retval = retval .. "pwdfield[10.5,1.6;1.86,0.39;te_pwd;" .. fgettext("Password:") .. "]"
|
||||
retval = retval .. "pwdfield[10.45,1.81;1.91,0.39;te_pwd;;]"
|
||||
end
|
||||
|
||||
if tabdata.fav_selected and fav_selected then
|
||||
if gamedata.fav then
|
||||
retval = retval .. "image_button[7.1,4.91;0.83,0.83;" .. core.formspec_escape(defaulttexturedir .. "trash.png")
|
||||
.. ";btn_delete_favorite;;;true]"
|
||||
.. ";btn_delete_favorite;;true;false]"
|
||||
end
|
||||
if fav_selected.description then
|
||||
retval = retval .. "textarea[7.5,2.2;4.8,3;;" ..
|
||||
|
|
|
@ -172,6 +172,5 @@ end
|
|||
|
||||
function mm_texture.set_dirt_bg()
|
||||
-- Use universal fallback texture in textures/base/pack
|
||||
local minimalpath = defaulttexturedir .. "bg.png"
|
||||
core.set_background("background", minimalpath, true, 256)
|
||||
core.set_background("background", defaulttexturedir .. "bg.png", true, 256)
|
||||
end
|
||||
|
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.7 KiB |
Before Width: | Height: | Size: 196 B After Width: | Height: | Size: 279 B |
Before Width: | Height: | Size: 201 B After Width: | Height: | Size: 241 B |
Before Width: | Height: | Size: 143 B After Width: | Height: | Size: 234 B |