education-apps/on_task_tracker/main_screen.gd

43 lines
1.1 KiB
GDScript3
Raw Normal View History

2022-10-21 09:42:42 +00:00
extends CanvasLayer
# Declare member variables here. Examples:
# var a: int = 2
# var b: String = "text"
var date_time
var check_time_var : int
onready var date_time_display = $"%CurrentTime"
onready var global_ints = $"/root/GlobalInts"
onready var minute_label = $"StartScreen/InstructionPanel/MinuteBox/MinuteLabel"
# Called when the node enters the scene tree for the first time.
func _ready():
minute_label.text = str(global_ints.observation_minutes)
func _process(_delta):
check_time_var += 1
#print(check_time_var)
if check_time_var == 10:
check_time_var = 0
date_time = OS.get_time()
date_time_display.text = str(date_time.hour, ":", date_time.minute)
func _on_MinuteMinus_pressed() -> void:
if global_ints.observation_minutes >= 2:
global_ints.observation_minutes -= 1
minute_label.text = str(global_ints.observation_minutes)
func _on_MinutePlus_pressed() -> void:
if global_ints.observation_minutes < 60:
global_ints.observation_minutes += 1
minute_label.text = str(global_ints.observation_minutes)
func _on_Manual_pressed() -> void:
var _error = OS.shell_open("https://www.internationalsengroup.org/resources/time-sampling-form/")