Swarm/Multiplayer/LobbyInfo.gd

29 lines
736 B
GDScript3
Raw Normal View History

extends CanvasLayer
@onready var lobby_code: Label = $PanelContainer/VBoxContainer/LobbyCode
@onready var start_game_button = $PanelContainer/VBoxContainer/StartGameButton
func _on_connect() -> void:
lobby_code.text = "Waiting for the host to start the game..."
# Called when the node enters the scene tree for the first time.
func _ready():
multiplayer.connected_to_server.connect(_on_connect)
if not multiplayer.is_server():
return
start_game_button.visible = true
lobby_code.text = GameData.lobby_code
# Called every frame. 'delta' is the elapsed time since the previous frame.
func _process(delta):
pass
func _on_button_pressed():
2024-03-23 16:18:30 +01:00
#WSClient.stop()
get_tree().change_scene_to_file("res://main_menu.tscn")