From 032d2583e67389cfe9ebae145c145d6cc2be7eb3 Mon Sep 17 00:00:00 2001 From: Dustin Date: Fri, 18 Apr 2025 19:23:40 -0700 Subject: [PATCH] UI tweaks for controllers on android. --- src/ui/lobby.gd | 6 +++++- src/ui/lobby.tscn | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/ui/lobby.gd b/src/ui/lobby.gd index da12233..a510776 100644 --- a/src/ui/lobby.gd +++ b/src/ui/lobby.gd @@ -14,6 +14,9 @@ func _ready(): else: var desktop_path = OS.get_system_dir(0).replace("\\", "/").split("/") $Connect/Name.text = desktop_path[desktop_path.size() - 2] + + $Connect/Join.grab_focus() + func _on_host_pressed(): @@ -28,7 +31,7 @@ func _on_host_pressed(): var player_name = $Connect/Name.text NetworkManager.host_game(player_name) refresh_lobby() - + $Players/Start.grab_focus() func _on_join_pressed(): if $Connect/Name.text == "": @@ -43,6 +46,7 @@ func _on_join_pressed(): $Connect/ErrorLabel.text = "" $Connect/Host.disabled = true $Connect/Join.disabled = true + $Players/Start.grab_focus() var player_name = $Connect/Name.text NetworkManager.join_game(ip, player_name) diff --git a/src/ui/lobby.tscn b/src/ui/lobby.tscn index fd00e35..e9be515 100644 --- a/src/ui/lobby.tscn +++ b/src/ui/lobby.tscn @@ -129,13 +129,14 @@ margin_bottom = 109.0 size_flags_horizontal = 2 size_flags_vertical = 2 custom_fonts/font = ExtResource( 2 ) -text = "127.0.0.1" +text = "192.168.0.133" [node name="Host" type="Button" parent="Connect"] margin_left = 181.0 margin_top = 31.0 margin_right = 246.0 margin_bottom = 51.0 +focus_neighbour_bottom = NodePath("../Join") size_flags_horizontal = 2 size_flags_vertical = 2 custom_fonts/font = ExtResource( 2 ) @@ -146,6 +147,7 @@ margin_left = 181.0 margin_top = 87.0 margin_right = 246.0 margin_bottom = 107.0 +focus_neighbour_top = NodePath("../Host") size_flags_horizontal = 2 size_flags_vertical = 2 custom_fonts/font = ExtResource( 2 )