claude godot 4 port
This commit is contained in:
+15
-17
@@ -1,30 +1,29 @@
|
||||
extends MarginContainer
|
||||
|
||||
var alarm:Alarm
|
||||
var alarm: Alarm
|
||||
var playing := false
|
||||
|
||||
onready var time_talker = $"../time talker"
|
||||
onready var weather_api_node = $"../WeatherAPINode"
|
||||
onready var snooze_timer = $"snooze timer"
|
||||
onready var snooze_button = $VBoxContainer/HBoxContainer/snooze
|
||||
onready var sleep_mode = $"../sleep_mode"
|
||||
@onready var time_talker = $"../time talker"
|
||||
@onready var weather_api_node = $"../WeatherAPINode"
|
||||
@onready var snooze_timer = $"snooze timer"
|
||||
@onready var snooze_button = $VBoxContainer/HBoxContainer/snooze
|
||||
@onready var sleep_mode = $"../sleep_mode"
|
||||
|
||||
var _day
|
||||
var _weather
|
||||
|
||||
func popup(alarm:Alarm):
|
||||
if !alarm.active:
|
||||
func popup(alarm_in: Alarm):
|
||||
if !alarm_in.active:
|
||||
return
|
||||
self.alarm = alarm
|
||||
|
||||
self.alarm = alarm_in
|
||||
|
||||
sleep_mode.prevent_sleep = true
|
||||
snooze_button.visible = alarm.snooze
|
||||
snooze_button.visible = alarm_in.snooze
|
||||
snooze_timer.stop()
|
||||
time_talker.stop()
|
||||
|
||||
|
||||
_weather = Constants.WEATHER.UNKNOWN
|
||||
var json = yield(weather_api_node.get_forecast(),"completed")
|
||||
var temperature = json['current']['temp_c']
|
||||
var json = await weather_api_node.get_forecast()
|
||||
if json is Dictionary:
|
||||
_weather = Constants.code_to_weather(json['current']['condition']['code'])
|
||||
_day = Time.get_date_dict_from_system()['weekday']
|
||||
@@ -38,7 +37,7 @@ func _play():
|
||||
time_talker.play(alarm.moment, _day, _weather, alarm.weather_music if alarm.override_weather_music else null, alarm.play_music, alarm.speak_time)
|
||||
|
||||
func _on_snooze_timer_timeout():
|
||||
if alarm!=null and !alarm.active:
|
||||
if alarm != null and !alarm.active:
|
||||
_on_stop_pressed()
|
||||
return
|
||||
show()
|
||||
@@ -59,9 +58,8 @@ func _on_snooze_pressed():
|
||||
print("Ya snooze...")
|
||||
playing = false
|
||||
time_talker.stop(2.5)
|
||||
snooze_timer.start(5*60)
|
||||
snooze_timer.start(5 * 60)
|
||||
self.hide()
|
||||
# snooze_timer.start(5)
|
||||
|
||||
|
||||
func _on_time_talker_finished():
|
||||
|
||||
Reference in New Issue
Block a user