TowerDefense/UI/label_team.gd
2025-08-30 00:46:34 +02:00

16 lines
492 B
GDScript

extends Label
func _ready() -> void:
EventBus.tower_count_changed.connect(_on_EventBus_tower_count_changed)
EventBus.team_in_action_changed.connect(_on_EventBus_team_in_action_changed)
func _on_EventBus_tower_count_changed(_value : int) -> void:
var _text = text.rsplit("/")
_text[1] = str(_value)
text = _text[0] + "/" + _text[1]
func _on_EventBus_team_in_action_changed(_value : int) -> void:
var _text = text.rsplit("/")
_text[0] = str(_value)
text = _text[0] + "/" + _text[1]