From 77d6b25f58bfecf1af018f930d3bcc93a1a87c51 Mon Sep 17 00:00:00 2001 From: John Breaux Date: Mon, 6 Dec 2021 13:07:53 -0600 Subject: [PATCH] Lobby: Load Net state on Lobby start, and show appropriate menus. --- godot_ship/script/network/Lobby.gd | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/godot_ship/script/network/Lobby.gd b/godot_ship/script/network/Lobby.gd index 3158a25..6ee20cd 100644 --- a/godot_ship/script/network/Lobby.gd +++ b/godot_ship/script/network/Lobby.gd @@ -27,9 +27,19 @@ func set_IP_Address_text(show): func _ready(): Net.connect("peers_updated", self, "_on_peers_updated") Net.connect("disconnected", self, "_on_Net_disconnected") + # Let the player name default to hostname name_popup.get_node("Name Entry").text = Net.get_hostname() + # Update the peers list _on_peers_updated() - pass + # Set the keyboard-control focus to the first valid focus + find_next_valid_focus().grab_focus() + # Resume a connection, if coming to this screen from a connected state (i.e. "restart gane" + if Net.hosting: + # Show the host IP address + set_IP_Address_text(true) + if Net.connected: + # Show "Connected Options" + show_Connected_Options() func show_Connected_Options(): # [Hide]/Show the host options