aboutsummaryrefslogtreecommitdiff
path: root/client/game.gd
diff options
context:
space:
mode:
authortpart <tpart120@proton.me>2024-07-15 13:08:59 +0200
committertpart <tpart120@proton.me>2024-07-15 13:08:59 +0200
commitd9ad661792297503fb0ea11f79ec153d8430f65b (patch)
treef352d6a16beb366027001bce3cf172b5518b90c0 /client/game.gd
parent7aef7f193dca90a5253944450196d2dd71fefed5 (diff)
downloadhurrycurry-d9ad661792297503fb0ea11f79ec153d8430f65b.tar
hurrycurry-d9ad661792297503fb0ea11f79ec153d8430f65b.tar.bz2
hurrycurry-d9ad661792297503fb0ea11f79ec153d8430f65b.tar.zst
Add join/spectate button; Join by default
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()