aboutsummaryrefslogtreecommitdiff
path: root/client/game.gd
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-07-15 15:00:50 +0200
committermetamuffin <metamuffin@disroot.org>2024-07-15 15:00:50 +0200
commit55f1cd9cd968b77121f1536cee963048ffe0acb0 (patch)
tree66a9d5994f4bc842e8322f2f7468157349b490ed /client/game.gd
parent340aa47c4652fe2f0ec5b0e4f293cfff407a0e6c (diff)
parentd9ad661792297503fb0ea11f79ec153d8430f65b (diff)
downloadhurrycurry-55f1cd9cd968b77121f1536cee963048ffe0acb0.tar
hurrycurry-55f1cd9cd968b77121f1536cee963048ffe0acb0.tar.bz2
hurrycurry-55f1cd9cd968b77121f1536cee963048ffe0acb0.tar.zst
Merge branch 'master' of https://codeberg.org/hurrycurry/hurrycurry
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()