Late connection
This commit is contained in:
parent
59bf07b076
commit
63209ccc1e
9 changed files with 73 additions and 23 deletions
|
|
@ -5,6 +5,7 @@ extends Label
|
|||
# Called when the node enters the scene tree for the first time.
|
||||
func _ready() -> void:
|
||||
Session.round_started.connect(update)
|
||||
Session.session_started.connect(update)
|
||||
|
||||
func update():
|
||||
if our_side:
|
||||
|
|
|
|||
|
|
@ -3,13 +3,5 @@ extends Node
|
|||
func _ready() -> void:
|
||||
Lobby.lobby_joined.connect(on_lobby_joined)
|
||||
|
||||
func _on_leave_button_pressed() -> void:
|
||||
Lobby.leave()
|
||||
$"../..".hide()
|
||||
$"../../../MainMenu".show()
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
Lobby.start_game.rpc()
|
||||
|
||||
func on_lobby_joined() -> void:
|
||||
$StartButton.hide()
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
extends Node
|
||||
extends Control
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
Lobby.lobby_joined.connect(hide_host_buttons)
|
||||
Session.session_started.connect(hide)
|
||||
Lobby.lobby_created.connect(show_host_buttons)
|
||||
Lobby.lobby_closed.connect(cleanup_lobby)
|
||||
Lobby.update_teams_state.connect(on_player_switched_team)
|
||||
|
|
@ -20,7 +21,7 @@ func cleanup_lobby() -> void:
|
|||
|
||||
|
||||
func _on_start_button_pressed() -> void:
|
||||
Lobby.start_game.rpc()
|
||||
Lobby.start_game()
|
||||
|
||||
func hide_host_buttons() -> void:
|
||||
%StartButton.hide()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue