From f04a8a483beb3d83082c5b21fbd67853dcc3f08f Mon Sep 17 00:00:00 2001 From: MoNTE48 Date: Tue, 12 Nov 2019 23:06:01 +0100 Subject: [PATCH] Mainmenu: some improvements --- builtin/mainmenu/init.lua | 40 +++++++++++++++---------------- builtin/mainmenu/tab_credits.lua | 10 ++++---- builtin/mainmenu/tab_local.lua | 6 ++--- builtin/mainmenu/tab_online.lua | 34 +++++++++++++++----------- builtin/mainmenu/textures.lua | 3 +-- textures/base/bg_online.png | Bin 2434 -> 2812 bytes textures/base/refresh.png | Bin 196 -> 279 bytes textures/base/search.png | Bin 201 -> 241 bytes textures/base/trash.png | Bin 143 -> 234 bytes 9 files changed, 48 insertions(+), 45 deletions(-) diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index 460c7f03..cedf1f90 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -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() diff --git a/builtin/mainmenu/tab_credits.lua b/builtin/mainmenu/tab_credits.lua index bea1b94f..b6196c2b 100644 --- a/builtin/mainmenu/tab_credits.lua +++ b/builtin/mainmenu/tab_credits.lua @@ -24,7 +24,7 @@ local multicraft_developers = { "sfan5 ", "Stuart Jones (stujones11) ", "Jean-Patrick Guerrero (kilbith) ", - "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) ", "Auke Kok (sofar) ", "rubenwardy ", - "Krock/SmallJoker ", + "Krock/SmallJoker " } local active_contributors = { @@ -50,7 +50,7 @@ local active_contributors = { "bigfoot547 [CSM]", "Rogier [Fixes]", "Wuzzy [Audiovisuals]", - "Shara/Ezhh [Settings]", + "Shara/Ezhh [Settings]" } local previous_core_developers = { @@ -63,7 +63,7 @@ local previous_core_developers = { "est31 ", "kahrl ", "Ryan Kwolek (kwolekr) ", - "sapier", + "sapier" } local previous_contributors = { @@ -80,7 +80,7 @@ local previous_contributors = { "Guiseppe Bilotta (Oblomov) [Fixes]", "matttpt [Fixes]", "Nils Dagsson Moskopp (erlehmann) [Minetest Logo]", - "Jeija [HTTP, particles]", + "Jeija [HTTP, particles]" } local function buildCreditList(source) diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index 9c46dc3c..976c33ee 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -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 } diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index cc9198a1..5030b172 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -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;;" .. diff --git a/builtin/mainmenu/textures.lua b/builtin/mainmenu/textures.lua index 646b2c54..4cca336b 100644 --- a/builtin/mainmenu/textures.lua +++ b/builtin/mainmenu/textures.lua @@ -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 diff --git a/textures/base/bg_online.png b/textures/base/bg_online.png index d183cb920e4826a9abf43965a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TZJh*?BRA(#SG)enC>Pnjh=7DC}23m$ZL|$k?PGjVy1{~BIhTUW0l&GwfReEw2E8pY|EbfyZ zuy9Xa!|KJ9<2ZROlgZ=<%si95*m%VInnZ1xx|s#|8gzm7xnE__-gW2rfk%@InO9Hd zWjC2TfhiEGmUprP+fk-u$;lVl#DPLKlQ%GPPu|0%iX<&QIe^I!Xe>yn_~rm6YeuF8 z?UOICNnlgI*@2Cb5ykufCLYF&$@AGHfkp?^pU4J>0tX~8j`O&OnlP*txZJJ$`P=gJ z-=&U69Rv;p7_c(0Uhp8^w|7m8k@4lT9Y6FNvwPb9J^%&}V}a-IBkhb9k?nbWJj`H` znox@@-UIWZ_SY3MtOJG^!`(Gg8DxTW_zr|JwgAJx!Gd8@o>&$`+#U-CorfBgk_R3! iWJt^KGK#UoVva%BC@n{0rG{iRNW|0C&t;ucLK6VkX1`Ye diff --git a/textures/base/refresh.png b/textures/base/refresh.png index 00094d233d3311a714def149d5acdd406cf2e668..8e0d28d21e39b6e033954c2ec18f2d45f7a5a301 100644 GIT binary patch delta 264 zcmV+j0r&pI0ha=h7=Ho-0002j2boO(000b7OjJex|NkU2SyN@4|NsBCe$#RQ0004W zQchCz!Ne8%Y>pH;4E$jX|z>mY{0lwww_jL%E8mnOd+kYVdrUBV{Gz_vG4G*e@ zU`q}#bJj3G$p+gY$4kiuQ}Q>08axN~0jl>Qcm~q@@Bros*#AJCY&F!$93&}{9dKCE zNN%A1v!PlIJIH3ks*M`v0N4f!U^f7;rlP delta 180 zcmbQvbcAt&L_H$|5Htz-6ay)yk|4ie28Oc9XDxudT2B|pkP61V#~9fTC`hnAm@cqD zxnzp$+Oo|zT$$Je6nygc)TbmIu>0^Zy>bT^L*Heg6S1977OH#-F`ML-ck$38QTGEz z^M7!kGkP%f!o+)>xvu+!es$FxD_(Qto1g0{uY+lfMU}cv-lZ*<4sV$-y=aoN<%xA~ gQi8qGHZJL`zgs4o!tBKvxgF#_Pgg&ebxsLQ0MQ>wmjD0& diff --git a/textures/base/search.png b/textures/base/search.png index c20d704b5cf297a12c663fea95737d04edb4d189..200cb19ec30df124dd2ce675a00a7388c0e35744 100644 GIT binary patch delta 225 zcmV<703QFz0r3Hl7=Ho-0002j2boO(000S4OjJex|NkBy9{>OUC?)0V00001bW%=J z06^y0W&i*HmPtfGRCr$1)Ugc%F$jfW%TgLfVVV?|eLM;!`lrm@HR0hpQi9~>Ym9lq zhK>6)OUaX b9eTY1zRp@acF)?300000NkvXXu0mjfNv>XE delta 185 zcmey!c#?5~L_H$|5Htz-6ay)yk|4ie28Oc9XDvX2o-U3d6^wh&GqSN5@~~crcVx6Z z6qAy>erv?7#a}gSofwbK(3w16Cc&`LF5{E^ym?j}vERDpwXK=H@JyP;uZ#J6CceGR zo%F-$Sug*jMCF^uSpPKskmG*rBGW5zwb`_P70>)BrA8^66XMpys6}K8Y!&96)17a{ kdDA7%WsT1<b?BIcrKhDRT=55nMdjo~!xNG`JQ+NdY;E!dZ2Jx@ a(Pm&M60tp8E7#)=vdPoc&t;ucLK6TKNh#0(