Align patterns better around what UI components are. Move script related controllers to scripts folder
This commit is contained in:
25
scenes/ui/game/game_ui.gd
Normal file
25
scenes/ui/game/game_ui.gd
Normal file
@@ -0,0 +1,25 @@
|
||||
extends Control
|
||||
|
||||
|
||||
@onready var panel: Panel = $panel
|
||||
@onready var win_message_lbl: RichTextLabel = $panel/win_message_lbl
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
setup_signals()
|
||||
setup_multiplayer()
|
||||
|
||||
func setup_signals() -> void:
|
||||
MessageBus.subscribe("declare_win_condition", _on_declare_win_condition)
|
||||
|
||||
func setup_multiplayer() -> void:
|
||||
if not Globals.multiplayer_data.is_multiplayer_active: return
|
||||
|
||||
|
||||
func _on_declare_win_condition(message: String) -> void:
|
||||
panel.visible = true
|
||||
win_message_lbl.text = message
|
||||
|
||||
await get_tree().create_timer(5).timeout
|
||||
|
||||
MessageBus.emit_local("game_peer_disconnected", null)
|
||||
Reference in New Issue
Block a user