Mainmenu: some improvements

This commit is contained in:
MoNTE48 2019-11-12 23:06:01 +01:00
parent 6dd73018b4
commit f04a8a483b
9 changed files with 48 additions and 45 deletions

View File

@ -25,7 +25,7 @@ mt_color_dark_green = "#25C191"
local menupath = core.get_mainmenu_path() local menupath = core.get_mainmenu_path()
local basepath = core.get_builtin_path() local basepath = core.get_builtin_path()
defaulttexturedir = core.get_texturepath_share() .. DIR_DELIM .. "base" .. DIR_DELIM 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 .. "async_event.lua")
dofile(basepath .. DIR_DELIM .. "common" .. DIR_DELIM .. "filterlist.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(basepath .. DIR_DELIM .. "fstk" .. DIR_DELIM .. "ui.lua")
dofile(menupath .. DIR_DELIM .. "common.lua") dofile(menupath .. DIR_DELIM .. "common.lua")
dofile(menupath .. DIR_DELIM .. "gamemgr.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_create_world.lua")
--dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua") --dofile(menupath .. DIR_DELIM .. "dlg_delete_mod.lua")
dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua") dofile(menupath .. DIR_DELIM .. "dlg_delete_world.lua")
--dofile(menupath .. DIR_DELIM .. "dlg_rename_modpack.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 .. "modmgr.lua")
-- dofile(menupath .. DIR_DELIM .. "store.lua") --dofile(menupath .. DIR_DELIM .. "store.lua")
dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua") dofile(menupath .. DIR_DELIM .. "dlg_settings_advanced.lua")
end 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.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua")
tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua") tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua")
--tabs.server = dofile(menupath .. DIR_DELIM .. "tab_server.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.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 end
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
@ -89,20 +90,20 @@ local function init_globals()
menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic) menudata.worldlist:add_sort_mechanism("alphabetic", sort_worlds_alphabetic)
menudata.worldlist:set_sortmode("alphabetic") menudata.worldlist:set_sortmode("alphabetic")
mm_texture.init() -- mm_texture.init()
-- Create main tabview -- Create main tabview
local tv_main = tabview_create("maintab", {x = 12, y = 5.4}, {x = 0, y = 0}) 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.local_game)
tv_main:add(tabs.play_online) 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.mods)
tv_main:add(tabs.settings)
tv_main:add(tabs.texturepacks)
end
--tv_main:add(tabs.mods)
tv_main:add(tabs.credits) tv_main:add(tabs.credits)
tv_main:set_autosave_tab(true) tv_main:set_autosave_tab(true)
@ -117,16 +118,13 @@ local function init_globals()
tv_main:show() tv_main:show()
-- Create modstore ui -- Create modstore ui
--if use_simple_menu then -- modstore.init({x = 12, y = 5.4}, 3, 2)
-- modstore.init({x = 12, y = 6}, 3, 2)
--else
-- modstore.init({x = 12, y = 8}, 4, 3)
--end
ui.update() ui.update()
minetest.set_clouds(false) core.set_clouds(false)
mm_texture.set_dirt_bg() -- mm_texture.set_dirt_bg()
core.set_background("background", defaulttexturedir .. "bg.png", true, 256)
end end
init_globals() init_globals()

View File

@ -24,7 +24,7 @@ local multicraft_developers = {
"sfan5 <sfan5@live.de>", "sfan5 <sfan5@live.de>",
"Stuart Jones (stujones11) <stujones111@gmail.com>", "Stuart Jones (stujones11) <stujones111@gmail.com>",
"Jean-Patrick Guerrero (kilbith) <jeanpatrick.guerrero@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 = { local core_developers = {
@ -37,7 +37,7 @@ local core_developers = {
"Craig Robbins (Zeno) <craig.d.robbins@gmail.com>", "Craig Robbins (Zeno) <craig.d.robbins@gmail.com>",
"Auke Kok (sofar) <sofar@foo-projects.org>", "Auke Kok (sofar) <sofar@foo-projects.org>",
"rubenwardy <rw@rubenwardy.com>", "rubenwardy <rw@rubenwardy.com>",
"Krock/SmallJoker <mk939@ymail.com>", "Krock/SmallJoker <mk939@ymail.com>"
} }
local active_contributors = { local active_contributors = {
@ -50,7 +50,7 @@ local active_contributors = {
"bigfoot547 [CSM]", "bigfoot547 [CSM]",
"Rogier <rogier777@gmail.com> [Fixes]", "Rogier <rogier777@gmail.com> [Fixes]",
"Wuzzy [Audiovisuals]", "Wuzzy [Audiovisuals]",
"Shara/Ezhh [Settings]", "Shara/Ezhh [Settings]"
} }
local previous_core_developers = { local previous_core_developers = {
@ -63,7 +63,7 @@ local previous_core_developers = {
"est31 <MTest31@outlook.com>", "est31 <MTest31@outlook.com>",
"kahrl <kahrl@gmx.net>", "kahrl <kahrl@gmx.net>",
"Ryan Kwolek (kwolekr) <kwolekr@minetest.net>", "Ryan Kwolek (kwolekr) <kwolekr@minetest.net>",
"sapier", "sapier"
} }
local previous_contributors = { local previous_contributors = {
@ -80,7 +80,7 @@ local previous_contributors = {
"Guiseppe Bilotta (Oblomov) <guiseppe.bilotta@gmail.com> [Fixes]", "Guiseppe Bilotta (Oblomov) <guiseppe.bilotta@gmail.com> [Fixes]",
"matttpt <matttpt@gmail.com> [Fixes]", "matttpt <matttpt@gmail.com> [Fixes]",
"Nils Dagsson Moskopp (erlehmann) <nils@dieweltistgarnichtso.net> [Minetest Logo]", "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) local function buildCreditList(source)

View File

@ -27,7 +27,7 @@ local function get_formspec()
core.formspec_escape(defaulttexturedir .. core.formspec_escape(defaulttexturedir ..
"blank.png") .. ";world_create;;true;false]" "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 .. retval = retval ..
"image_button[6.72,1.43;4.96,1.41;" .. "image_button[6.72,1.43;4.96,1.41;" ..
core.formspec_escape(defaulttexturedir .. core.formspec_escape(defaulttexturedir ..
@ -35,7 +35,7 @@ local function get_formspec()
"image_button[7.33,3.09;3.73,0.86;" .. "image_button[7.33,3.09;3.73,0.86;" ..
core.formspec_escape(defaulttexturedir .. core.formspec_escape(defaulttexturedir ..
creative_checkbox) .. creative_checkbox) ..
";cb_creative_mode;;true;false]" .. ".png;cb_creative_mode;;true;false]" ..
"textlist[-0.01,0;6.28,4.64;sp_worlds;" .. "textlist[-0.01,0;6.28,4.64;sp_worlds;" ..
menu_render_worldlist() .. menu_render_worldlist() ..
";" .. index .. ";true]" ";" .. index .. ";true]"
@ -184,5 +184,5 @@ return {
name = "local", name = "local",
caption = fgettext("Singleplayer"), caption = fgettext("Singleplayer"),
cbf_formspec = get_formspec, cbf_formspec = get_formspec,
cbf_button_handler = main_button_handler, cbf_button_handler = main_button_handler
} }

View File

@ -35,40 +35,46 @@ local function get_formspec(_, _, tabdata)
local retval = local retval =
-- Search -- Search
"field[0.2,0.1;5.71,1;te_search;;" .. core.formspec_escape(tabdata.search_for) .. "]" .. "field[0.2,0.1;5.8,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") "image_button[5.5,-0.13;0.83,0.83;" .. core.formspec_escape(defaulttexturedir .. "search.png")
.. ";btn_mp_search;" .. "]" .. .. ";btn_mp_search;;true;false]" ..
"image_button[6.26,-0.13;0.83,0.83;" .. core.formspec_escape(defaulttexturedir .. "refresh.png") "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 -- 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")) .. "]" .. 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")) .. "]" .. core.formspec_escape(core.settings:get("remote_port")) .. "]" ..
-- Password -- Name
"field[7.4,1.6;3.2,0.5;te_name;" .. fgettext("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")) .. "]" .. core.formspec_escape(core.settings:get("name")) .. "]" ..
-- Description Background -- Description Background
"box[7.1,2;4.8,2.75;#999999]".. "box[7.1,2.1;4.8,2.65;#999999]"..
-- Connect -- 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 -- Password
if password_save then 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")) .. "]" core.formspec_escape(core.settings:get("password")) .. "]"
else 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 end
if tabdata.fav_selected and fav_selected then if tabdata.fav_selected and fav_selected then
if gamedata.fav then if gamedata.fav then
retval = retval .. "image_button[7.1,4.91;0.83,0.83;" .. core.formspec_escape(defaulttexturedir .. "trash.png") 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 end
if fav_selected.description then if fav_selected.description then
retval = retval .. "textarea[7.5,2.2;4.8,3;;" .. retval = retval .. "textarea[7.5,2.2;4.8,3;;" ..

View File

@ -172,6 +172,5 @@ end
function mm_texture.set_dirt_bg() function mm_texture.set_dirt_bg()
-- Use universal fallback texture in textures/base/pack -- Use universal fallback texture in textures/base/pack
local minimalpath = defaulttexturedir .. "bg.png" core.set_background("background", defaulttexturedir .. "bg.png", true, 256)
core.set_background("background", minimalpath, true, 256)
end end

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 196 B

After

Width:  |  Height:  |  Size: 279 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 201 B

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 B

After

Width:  |  Height:  |  Size: 234 B