1
0
mirror of https://github.com/JohnBreaux/Boat-Battle.git synced 2024-11-15 05:25:57 +00:00

Lobby: Load Net state on Lobby start, and show appropriate menus.

This commit is contained in:
John 2021-12-06 13:07:53 -06:00
parent 4a2d577e9c
commit 77d6b25f58

View File

@ -27,9 +27,19 @@ func set_IP_Address_text(show):
func _ready(): func _ready():
Net.connect("peers_updated", self, "_on_peers_updated") Net.connect("peers_updated", self, "_on_peers_updated")
Net.connect("disconnected", self, "_on_Net_disconnected") Net.connect("disconnected", self, "_on_Net_disconnected")
# Let the player name default to hostname
name_popup.get_node("Name Entry").text = Net.get_hostname() name_popup.get_node("Name Entry").text = Net.get_hostname()
# Update the peers list
_on_peers_updated() _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(): func show_Connected_Options():
# [Hide]/Show the host options # [Hide]/Show the host options