2021-05-20 04:54:00 -04:00
|
|
|
extends Node2D
|
|
|
|
|
2021-05-26 03:35:52 -04:00
|
|
|
onready var rotate_news = $RotateNews
|
2021-05-27 10:33:08 -04:00
|
|
|
onready var day_cycle = $DayCycle
|
2021-05-27 13:54:08 -04:00
|
|
|
onready var turtle_btn = $Controls/Status/StatCtr/ButtonCtr/TurtleBtn
|
|
|
|
onready var cheeta_btn = $Controls/Status/StatCtr/ButtonCtr/CheetaBtn
|
2021-05-20 04:54:00 -04:00
|
|
|
|
2021-05-26 03:35:52 -04:00
|
|
|
func _ready():
|
|
|
|
SimEvents.connect("resume_news", self, "_resume_rotation")
|
|
|
|
SimEvents.connect("send_alert", self, "_stop_news")
|
2021-05-26 05:50:47 -04:00
|
|
|
|
2021-05-26 03:35:52 -04:00
|
|
|
func _stop_news():
|
|
|
|
rotate_news.stop()
|
|
|
|
|
|
|
|
func _resume_rotation():
|
|
|
|
rotate_news.start()
|
2021-05-27 10:33:08 -04:00
|
|
|
|
|
|
|
func _on_DayCycle_timeout():
|
|
|
|
|
2021-05-27 22:31:40 -04:00
|
|
|
# Increment the number days until it reaches 30
|
2021-05-29 03:09:09 -04:00
|
|
|
if SimTime.prev_day < 30:
|
|
|
|
SimTime.increment_day(1)
|
2021-05-27 10:33:08 -04:00
|
|
|
|
2021-05-27 22:31:40 -04:00
|
|
|
# Reset the number of days to 1 on day 30 and increment the month
|
2021-05-29 03:09:09 -04:00
|
|
|
if SimTime.prev_day == 30:
|
|
|
|
SimTime.reset_day()
|
|
|
|
|
|
|
|
# Increment month up until the 12th
|
|
|
|
if SimTime.prev_month != 12:
|
|
|
|
SimTime.increment_month(1)
|
|
|
|
|
2021-05-27 10:33:08 -04:00
|
|
|
SimEvents.emit_signal("budget")
|
2021-05-27 22:31:40 -04:00
|
|
|
|
|
|
|
# Increment the year on the 12th month
|
2021-05-29 03:09:09 -04:00
|
|
|
if SimTime.prev_month == 12:
|
|
|
|
SimTime.new_year()
|
|
|
|
|
2021-05-27 10:33:08 -04:00
|
|
|
func _on_TurtleBtn_toggled(button_pressed):
|
|
|
|
if button_pressed:
|
|
|
|
day_cycle.wait_time = 12
|
|
|
|
cheeta_btn.pressed = false
|
|
|
|
|
|
|
|
func _on_CheetaBtn_toggled(button_pressed):
|
|
|
|
if button_pressed:
|
|
|
|
day_cycle.wait_time = 2
|
|
|
|
turtle_btn.pressed = false
|
2021-05-27 13:54:08 -04:00
|
|
|
|
2021-09-24 11:12:02 -04:00
|
|
|
func _on_VRMode_pressed():
|
|
|
|
get_tree().change_scene("res://scenes/VR Game.tscn")
|