summaryrefslogtreecommitdiff
path: root/client/game.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/game.gd')
-rw-r--r--client/game.gd6
1 files changed, 6 insertions, 0 deletions
diff --git a/client/game.gd b/client/game.gd
index c18f8d67..04aa7518 100644
--- a/client/game.gd
+++ b/client/game.gd
@@ -243,12 +243,18 @@ func _ready():
mp.set_ingame.connect(
func toggle_lobby(_state: bool, lobby_state: bool):
lobby.visible = lobby_state
+ if lobby_state and not join_sent:
+ join()
)
func join():
join_sent = true
mp.send_join(Global.get_profile("username"), Global.get_profile("character"))
+func leave():
+ join_sent = false
+ mp.send_leave()
+
func _process(delta):
update_center()