2022-11-09 12:09:17 +00:00
|
|
|
extends Control
|
|
|
|
|
2023-03-29 12:32:57 +00:00
|
|
|
@onready var player_vars = get_node("/root/PlayerVariables")
|
|
|
|
@onready var game_time = get_node("/root/GameTimer")
|
|
|
|
@onready var finances = get_node("/root/Finances")
|
2022-11-09 12:09:17 +00:00
|
|
|
|
|
|
|
var estimate_month
|
|
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
|
|
func _ready():
|
2023-03-29 12:32:57 +00:00
|
|
|
game_time.connect("heartbeat", Callable(self, "_on_heartbeat"))
|
2022-11-09 12:09:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
func _on_heartbeat():
|
|
|
|
estimate_month = player_vars.pupils_income - player_vars.operating_costs - player_vars.salary_cost
|
|
|
|
$BuildingCostNumber.text = str(player_vars.operating_costs)
|
|
|
|
$TeacherCostNumber.text = str(player_vars.salary_cost)
|
|
|
|
$PupilIncomeNumber.text = str(player_vars.pupils_income)
|
|
|
|
$TotalNumber.text = str(estimate_month)
|