From 94eba15c34960d09ecf0cd3929eb3e3f110f05ef Mon Sep 17 00:00:00 2001 From: Gregor Parzefall <82708541+grorp@users.noreply.github.com> Date: Sun, 1 Oct 2023 11:19:52 +0200 Subject: [PATCH] Misc. mainmenu fixes (#13859) * settingstypes.txt: Fix wrong default value for profiler.report_path * Disable Irrlicht file picker on Android (It doesn't work.) * Join Game tab: Fix server description textarea being misaligned with background * Reduce distance between tab and gamebar on Android Allows using a higher gui_scaling value without the gamebar going off-screen. Co-authored-by: ROllerozxa --- builtin/mainmenu/settings/components.lua | 18 +++++++++++++----- builtin/mainmenu/tab_local.lua | 8 ++++++-- builtin/mainmenu/tab_online.lua | 2 +- builtin/settingtypes.txt | 2 +- 4 files changed, 21 insertions(+), 9 deletions(-) diff --git a/builtin/mainmenu/settings/components.lua b/builtin/mainmenu/settings/components.lua index 1ddea6f0d..5ae0cf567 100644 --- a/builtin/mainmenu/settings/components.lua +++ b/builtin/mainmenu/settings/components.lua @@ -192,7 +192,7 @@ function make.enum(setting) end -function make.path(setting) +local function make_path(setting) return { info_text = setting.comment, setting = setting, @@ -235,6 +235,15 @@ function make.path(setting) } end +if PLATFORM == "Android" then + -- The Irrlicht file picker doesn't work on Android. + make.path = make.string + make.filepath = make.string +else + make.path = make_path + make.filepath = make_path +end + function make.v3f(setting) return { @@ -362,7 +371,7 @@ function make.flags(setting) end -local function noise_params(setting) +local function make_noise_params(setting) return { info_text = setting.comment, setting = setting, @@ -390,9 +399,8 @@ local function noise_params(setting) } end +make.noise_params_2d = make_noise_params +make.noise_params_3d = make_noise_params -make.filepath = make.path -make.noise_params_2d = noise_params -make.noise_params_3d = noise_params return make diff --git a/builtin/mainmenu/tab_local.lua b/builtin/mainmenu/tab_local.lua index efa7667da..38041e2d0 100644 --- a/builtin/mainmenu/tab_local.lua +++ b/builtin/mainmenu/tab_local.lua @@ -93,8 +93,12 @@ function singleplayer_refresh_gamebar() end end - local btnbar = buttonbar_create("game_button_bar", {x = 0, y = 7.475}, - {x = 15.5, y = 1.25}, "#000000", game_buttonbar_button_handler) + local btnbar = buttonbar_create( + "game_button_bar", + TOUCHSCREEN_GUI and {x = 0, y = 7.25} or {x = 0, y = 7.475}, + {x = 15.5, y = 1.25}, + "#000000", + game_buttonbar_button_handler) for _, game in ipairs(pkgmgr.games) do local btn_name = "game_btnbar_" .. game.id diff --git a/builtin/mainmenu/tab_online.lua b/builtin/mainmenu/tab_online.lua index 8a0de4eda..cbe946c8b 100644 --- a/builtin/mainmenu/tab_online.lua +++ b/builtin/mainmenu/tab_online.lua @@ -114,7 +114,7 @@ local function get_formspec(tabview, name, tabdata) "server_favorite_delete.png") .. ";btn_delete_favorite;]" end if gamedata.serverdescription then - retval = retval .. "textarea[0.25,1.85;5.2,2.75;;;" .. + retval = retval .. "textarea[0.25,1.85;5.25,2.7;;;" .. core.formspec_escape(gamedata.serverdescription) .. "]" end end diff --git a/builtin/settingtypes.txt b/builtin/settingtypes.txt index 2d53ff91d..4085e6aee 100644 --- a/builtin/settingtypes.txt +++ b/builtin/settingtypes.txt @@ -1717,7 +1717,7 @@ profiler.load (Load the game profiler) bool false profiler.default_report_format (Default report format) enum txt txt,csv,lua,json,json_pretty # The file path relative to your worldpath in which profiles will be saved to. -profiler.report_path (Report path) string "" +profiler.report_path (Report path) string # Instrument the methods of entities on registration. instrument.entity (Entity methods) bool true