summaryrefslogtreecommitdiff
path: root/scripts/morale.gd
blob: 613c7f571e58542d3bf3e5d59181e29a08207617 (plain)
1
2
3
4
5
6
7
8
9
10
11
extends Label

func _ready():
	GameData.connect("morale_changed", Callable(self, "_on_morale_changed"))
	update_label(GameData.get_morale())

func _on_morale_changed(new_morale: int) -> void:
	update_label(new_morale)

func update_label(new_morale: int) -> void:
	text = "Morale:" + str(new_morale)