From 17c34f9eb699822a01106e7535d9944b3469f367 Mon Sep 17 00:00:00 2001 From: Migdyn Date: Sat, 8 Oct 2022 22:50:20 -0400 Subject: [PATCH] Updated the main menu --- builtin/mainmenu/game_theme.lua | 20 +++++-------- builtin/mainmenu/init.lua | 11 ++++--- builtin/mainmenu/tab_about.lua | 21 +++++++++---- builtin/mainmenu/tab_beta.lua | 52 +++++++++++++++++++++++++++++++++ 4 files changed, 82 insertions(+), 22 deletions(-) create mode 100644 builtin/mainmenu/tab_beta.lua diff --git a/builtin/mainmenu/game_theme.lua b/builtin/mainmenu/game_theme.lua index 89e1b66..9a736ff 100644 --- a/builtin/mainmenu/game_theme.lua +++ b/builtin/mainmenu/game_theme.lua @@ -29,6 +29,11 @@ function mm_game_theme.init() mm_game_theme.gameid = nil mm_game_theme.music_handle = nil + + core.set_clouds(false) + if not have_bg then + mm_game_theme.set_dirt_bg() + end end -------------------------------------------------------------------------------- @@ -63,11 +68,7 @@ function mm_game_theme.reset() mm_game_theme.set_generic("header") if not have_bg then - if core.settings:get_bool("menu_clouds") then - core.set_clouds(true) - else - mm_game_theme.set_dirt_bg() - end + mm_game_theme.set_dirt_bg() end if mm_game_theme.music_handle ~= nil then @@ -93,12 +94,7 @@ function mm_game_theme.update_game(gamedetails) core.set_clouds(false) if not have_bg then - - if core.settings:get_bool("menu_clouds") then - core.set_clouds(true) - else - mm_game_theme.set_dirt_bg() - end + mm_game_theme.set_dirt_bg() end mm_game_theme.set_game("footer",gamedetails) @@ -182,7 +178,7 @@ end -------------------------------------------------------------------------------- function mm_game_theme.set_dirt_bg() if mm_game_theme.texturepack ~= nil then - local path = mm_game_theme.texturepack .. DIR_DELIM .."default_dirt.png" + local path = defaulttexturedir .. "bg.png" if core.set_background("background", path, true, 128) then return true end diff --git a/builtin/mainmenu/init.lua b/builtin/mainmenu/init.lua index c3a28a5..039c922 100644 --- a/builtin/mainmenu/init.lua +++ b/builtin/mainmenu/init.lua @@ -56,6 +56,7 @@ tabs.content = dofile(menupath .. DIR_DELIM .. "tab_content.lua") tabs.about = dofile(menupath .. DIR_DELIM .. "tab_about.lua") tabs.local_game = dofile(menupath .. DIR_DELIM .. "tab_local.lua") tabs.play_online = dofile(menupath .. DIR_DELIM .. "tab_online.lua") +tabs.beta = dofile(menupath .. DIR_DELIM .. "tab_beta.lua") -------------------------------------------------------------------------------- local function main_event_handler(tabview, event) @@ -98,6 +99,9 @@ local function init_globals() -- note: size would be 15.5,7.1 in real coordinates mode tv_main:set_autosave_tab(true) + + tv_main:add(tabs.beta) + tv_main:add(tabs.local_game) tv_main:add(tabs.play_online) @@ -108,10 +112,9 @@ local function init_globals() tv_main:set_global_event_handler(main_event_handler) tv_main:set_fixed_size(false) - local last_tab = core.settings:get("maintab_LAST") - if last_tab and tv_main.current_tab ~= last_tab then - tv_main:set_tab(last_tab) - end + + tv_main:set_tab(tabs.beta) + -- In case the folder of the last selected game has been deleted, -- display "Minetest" as a header diff --git a/builtin/mainmenu/tab_about.lua b/builtin/mainmenu/tab_about.lua index 6188b3b..c8628c8 100644 --- a/builtin/mainmenu/tab_about.lua +++ b/builtin/mainmenu/tab_about.lua @@ -17,9 +17,14 @@ -- https://github.com/orgs/minetest/teams/engine/members +local xtreemtest_developers = { +"Migdyn (a.k.a. Mike) [XtreemTest founder]", +"Looki2000", +"Kacper Kostka ", +} + local core_developers = { "Perttu Ahola (celeron55) [MineTest founder]", - "Migdyn (a.k.a. Mike) [XtreemTest founder]", "sfan5 ", "ShadowNinja ", "Nathanaƫlle Courant (Nore/Ekdohibs) ", @@ -125,27 +130,31 @@ return { local credit_list = {} table.insert_all(credit_list, { - core.colorize("#ff0", fgettext("Core Developers")) + core.colorize("#ff0", fgettext("XtreemTest Developers")) + }) + prepare_credits(credit_list, xtreemtest_developers) + table.insert_all(credit_list, { + core.colorize("#ff0", fgettext("Core MineTest Developers")) }) prepare_credits(credit_list, core_developers) table.insert_all(credit_list, { "", - core.colorize("#ff0", fgettext("Core Team")) + core.colorize("#ff0", fgettext("Core MineTest Team")) }) prepare_credits(credit_list, core_team) table.insert_all(credit_list, { "", - core.colorize("#ff0", fgettext("Active Contributors")) + core.colorize("#ff0", fgettext("Active MineTest Contributors")) }) prepare_credits(credit_list, active_contributors) table.insert_all(credit_list, { "", - core.colorize("#ff0", fgettext("Previous Core Developers")) + core.colorize("#ff0", fgettext("Previous MineTest Core Developers")) }) prepare_credits(credit_list, previous_core_developers) table.insert_all(credit_list, { "", - core.colorize("#ff0", fgettext("Previous Contributors")) + core.colorize("#ff0", fgettext("Previous MineTest Contributors")) }) prepare_credits(credit_list, previous_contributors) local credit_fs, scroll_height = build_hacky_list(credit_list) diff --git a/builtin/mainmenu/tab_beta.lua b/builtin/mainmenu/tab_beta.lua new file mode 100644 index 0000000..1ef76ed --- /dev/null +++ b/builtin/mainmenu/tab_beta.lua @@ -0,0 +1,52 @@ +--Minetest +--Copyright (C) 2013 sapier +--Copyright (C) 2022 Migdyn +-- +--This program is free software; you can redistribute it and/or modify +--it under the terms of the GNU Lesser General Public License as published by +--the Free Software Foundation; either version 2.1 of the License, or +--(at your option) any later version. +-- +--This program is distributed in the hope that it will be useful, +--but WITHOUT ANY WARRANTY; without even the implied warranty of +--MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +--GNU Lesser General Public License for more details. +-- +--You should have received a copy of the GNU Lesser General Public License along +--with this program; if not, write to the Free Software Foundation, Inc., +--51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +-- https://github.com/orgs/minetest/teams/engine/members + + +return { + name = "beta", + caption = fgettext("Beta Menu"), + cbf_formspec = function(tabview, name, tabdata) + + local version = core.get_version() + + + local fs = "image[1.5,0.6;7.5,2.5;" .. core.formspec_escape(defaulttexturedir .. "menu_header.png") .. "]" .. + "style[label_button;border=false]" .. + "button[0.1,4;8.3,1.5;online_play;Play on-line (real people, not bots)]" .. + "button[0.1,6;8.3,1.5;local_play;Play locally]" .. + "button[0.1,8;8.3,1.5;xtreemcoins;Get XtreemCoins]" + + + return fs, "size[15.5,10.1,false]real_coordinates[true]" + end, + cbf_button_handler = function(this, fields, name, tabdata) + if fields.online_play then + + end + + if fields.local_play then + + end + + if fields.xtreemcoins then + + end + end, +}