Skip to content

Commit

Permalink
Misc. mainmenu fixes (minetest#13859)
Browse files Browse the repository at this point in the history
* 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 <rollerozxa@voxelmanip.se>
  • Loading branch information
2 people authored and kawogi committed Dec 19, 2023
1 parent 79f12c9 commit 7af771f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
18 changes: 13 additions & 5 deletions builtin/mainmenu/settings/components.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
8 changes: 6 additions & 2 deletions builtin/mainmenu/tab_local.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion builtin/mainmenu/tab_online.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion builtin/settingtypes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7af771f

Please sign in to comment.