TowerDefense/UI/label_team.gd

17 lines
501 B
GDScript3
Raw Normal View History

2025-06-18 12:19:43 +02:00
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 : Array) -> void:
var _text = text.rsplit("/")
_text[0] = str(_value.size())
text = _text[0] + "/" + _text[1]