UI tweaks for controllers on android.

This commit is contained in:
Dustin 2025-04-18 19:23:40 -07:00
parent 9283a3263f
commit 032d2583e6
2 changed files with 8 additions and 2 deletions

View File

@ -15,6 +15,9 @@ func _ready():
var desktop_path = OS.get_system_dir(0).replace("\\", "/").split("/") var desktop_path = OS.get_system_dir(0).replace("\\", "/").split("/")
$Connect/Name.text = desktop_path[desktop_path.size() - 2] $Connect/Name.text = desktop_path[desktop_path.size() - 2]
$Connect/Join.grab_focus()
func _on_host_pressed(): func _on_host_pressed():
if $Connect/Name.text == "": if $Connect/Name.text == "":
@ -28,7 +31,7 @@ func _on_host_pressed():
var player_name = $Connect/Name.text var player_name = $Connect/Name.text
NetworkManager.host_game(player_name) NetworkManager.host_game(player_name)
refresh_lobby() refresh_lobby()
$Players/Start.grab_focus()
func _on_join_pressed(): func _on_join_pressed():
if $Connect/Name.text == "": if $Connect/Name.text == "":
@ -43,6 +46,7 @@ func _on_join_pressed():
$Connect/ErrorLabel.text = "" $Connect/ErrorLabel.text = ""
$Connect/Host.disabled = true $Connect/Host.disabled = true
$Connect/Join.disabled = true $Connect/Join.disabled = true
$Players/Start.grab_focus()
var player_name = $Connect/Name.text var player_name = $Connect/Name.text
NetworkManager.join_game(ip, player_name) NetworkManager.join_game(ip, player_name)

View File

@ -129,13 +129,14 @@ margin_bottom = 109.0
size_flags_horizontal = 2 size_flags_horizontal = 2
size_flags_vertical = 2 size_flags_vertical = 2
custom_fonts/font = ExtResource( 2 ) custom_fonts/font = ExtResource( 2 )
text = "127.0.0.1" text = "192.168.0.133"
[node name="Host" type="Button" parent="Connect"] [node name="Host" type="Button" parent="Connect"]
margin_left = 181.0 margin_left = 181.0
margin_top = 31.0 margin_top = 31.0
margin_right = 246.0 margin_right = 246.0
margin_bottom = 51.0 margin_bottom = 51.0
focus_neighbour_bottom = NodePath("../Join")
size_flags_horizontal = 2 size_flags_horizontal = 2
size_flags_vertical = 2 size_flags_vertical = 2
custom_fonts/font = ExtResource( 2 ) custom_fonts/font = ExtResource( 2 )
@ -146,6 +147,7 @@ margin_left = 181.0
margin_top = 87.0 margin_top = 87.0
margin_right = 246.0 margin_right = 246.0
margin_bottom = 107.0 margin_bottom = 107.0
focus_neighbour_top = NodePath("../Host")
size_flags_horizontal = 2 size_flags_horizontal = 2
size_flags_vertical = 2 size_flags_vertical = 2
custom_fonts/font = ExtResource( 2 ) custom_fonts/font = ExtResource( 2 )