TowerDefense/UI/label_team.gd

17 lines
492 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]
2025-08-30 00:46:34 +02:00
func _on_EventBus_team_in_action_changed(_value : int) -> void:
2025-06-18 12:19:43 +02:00
var _text = text.rsplit("/")
2025-08-30 00:46:34 +02:00
_text[0] = str(_value)
2025-06-18 12:19:43 +02:00
text = _text[0] + "/" + _text[1]