school-game/godot/DebugMenu.gd

23 lines
650 B
GDScript

extends Control
@onready var player_vars = get_node("/root/PlayerVariables")
@onready var game_time = get_node("/root/GameTimer")
func _ready():
game_time.connect("heartbeat", Callable(self, "_on_heartbeat"))
func _on_heartbeat():
$PupilsLabel.text = str(player_vars.pupil_pop)
$TeacherLabel.text = str(player_vars.teacher_pop)
$ClassroomLabel.text = str(player_vars.classroom_count)
if player_vars.has_cpdroom == true:
$CPDRoomLabel.text = str("HasCPDRoom")
func _on_AddMoney_pressed():
player_vars.funds += 100000
func _on_StaffroomButton_pressed():
if player_vars.has_staffroom == true:
$StaffroomLabel.text = str("HasStaffroom")