2024-03-16 02:36:45 +01:00
|
|
|
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
|
|
|
|
|
|
2024-03-22 01:37:05 +01:00
|
|
|
lobby_code.text = GameData.lobby_code
|
2024-03-16 02:36:45 +01:00
|
|
|
|
|
|
|
|
# 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()
|
2024-03-16 02:36:45 +01:00
|
|
|
get_tree().change_scene_to_file("res://main_menu.tscn")
|