claude godot 4 port

This commit is contained in:
2026-06-13 16:08:36 -04:00
parent aa1f470a7b
commit 1c1109fe93
227 changed files with 3112 additions and 2505 deletions
+6 -7
View File
@@ -5,17 +5,16 @@ signal selected(idx)
func _ready():
var x := 0
for item in get_children():
item.connect("toggled",self,"_on_button_toggled", [x])
item.toggled.connect(_on_button_toggled.bind(x))
x += 1
func select(index:int):
func select(index: int):
var x := 0
for item in get_children():
item.set_pressed_no_signal( x == index )
if item.pressed:
emit_signal("selected", x)
item.set_pressed_no_signal(x == index)
if item.button_pressed:
selected.emit(x)
x += 1
func _on_button_toggled(state:bool, idx:int):
func _on_button_toggled(state: bool, idx: int):
select(idx)
+1
View File
@@ -0,0 +1 @@
uid://c2b4dt8dhyf8g
+7 -7
View File
@@ -1,18 +1,18 @@
extends VBoxContainer
var alarm_res:Alarm
onready var alarm_node = $"/root/main/alarm"
var alarm_res: Alarm
@onready var alarm_node = $"/root/main/alarm"
signal edit()
func _ready():
Config.connect("changed", self ,"_update")
Config.changed.connect(_update)
self.modulate.a = 0
var tween = get_tree().create_tween()
tween.set_trans(Tween.TRANS_CUBIC)
tween.tween_property(self, "modulate:a", 1.0, 0.5)
tween.play()
print(alarm_res)
_update()
@@ -20,7 +20,7 @@ func _ready():
func _update():
$"%hour".text = alarm_res.moment.padded_hour()
$"%minute".text = alarm_res.moment.padded_minute()
$"%active".pressed = alarm_res.active
$"%active".button_pressed = alarm_res.active
func _on_active_toggled(button_pressed):
@@ -41,7 +41,7 @@ func _on_delete_button_pressed():
tween.set_trans(Tween.TRANS_CUBIC)
tween.tween_property(self, "modulate:a", 0.0, 0.5)
tween.play()
yield(tween, "finished")
await tween.finished
self.queue_free()
if alarm_res:
Config.flags.remove_alarm(alarm_res)
@@ -50,4 +50,4 @@ func _on_delete_button_pressed():
func _on_edit_button_pressed():
if self.modulate.a != 1:
return
emit_signal("edit")
edit.emit()
+1
View File
@@ -0,0 +1 @@
uid://b4wofhc0ow47i
+66 -66
View File
@@ -1,125 +1,125 @@
[gd_scene load_steps=7 format=2]
[gd_scene load_steps=7 format=3]
[ext_resource path="res://assets/texture/buttons/toggle_on.png" type="Texture" id=1]
[ext_resource path="res://assets/texture/buttons/toggle_off.png" type="Texture" id=2]
[ext_resource path="res://assets/main.tres" type="Theme" id=3]
[ext_resource path="res://assets/font/resource/alarm_item_time.tres" type="DynamicFont" id=4]
[ext_resource path="res://scenes/alarms_screen/alarms_item.gd" type="Script" id=5]
[ext_resource path="res://assets/texture/alarms/mark.png" type="Texture" id=6]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/toggle_on.png" id="1"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/toggle_off.png" id="2"]
[ext_resource type="Theme" path="res://assets/main.tres" id="3"]
[ext_resource type="FontVariation" path="res://assets/font/resource/alarm_item_time.tres" id="4"]
[ext_resource type="Script" path="res://scenes/alarms_screen/alarms_item.gd" id="5"]
[ext_resource type="Texture2D" path="res://assets/texture/alarms/mark.png" id="6"]
[node name="alarms_item" type="VBoxContainer" groups=["alarm_items", "minute_timer_updates"]]
anchor_right = 1.0
anchor_bottom = 0.09
rect_min_size = Vector2( 0, 55 )
custom_minimum_size = Vector2(0, 55)
mouse_filter = 2
size_flags_horizontal = 3
theme = ExtResource( 3 )
script = ExtResource( 5 )
__meta__ = {
"_edit_use_anchors_": true
}
theme = ExtResource("3")
script = ExtResource("5")
[node name="ColorRect" type="ColorRect" parent="."]
margin_right = 350.0
margin_bottom = 2.0
rect_min_size = Vector2( 0, 2 )
offset_right = 350.0
offset_bottom = 2.0
custom_minimum_size = Vector2(0, 2)
mouse_filter = 2
size_flags_horizontal = 3
color = Color( 1, 1, 1, 0.109804 )
color = Color(1, 1, 1, 0.109804)
[node name="HBoxContainer" type="HBoxContainer" parent="."]
margin_top = 6.0
margin_right = 350.0
margin_bottom = 52.0
offset_top = 6.0
offset_right = 350.0
offset_bottom = 52.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="delete_button" type="TextureButton" parent="HBoxContainer"]
margin_right = 46.0
margin_bottom = 46.0
rect_min_size = Vector2( 46, 0 )
hint_tooltip = "Delete alarm"
offset_right = 46.0
offset_bottom = 46.0
custom_minimum_size = Vector2(46, 0)
tooltip_text = "Delete alarm"
mouse_default_cursor_shape = 2
texture_normal = ExtResource( 6 )
expand = true
texture_normal = ExtResource("6")
ignore_texture_size = true
stretch_mode = 5
[node name="MarginContainer" type="MarginContainer" parent="HBoxContainer"]
margin_left = 50.0
margin_right = 106.0
margin_bottom = 46.0
offset_left = 50.0
offset_right = 106.0
offset_bottom = 46.0
mouse_filter = 2
custom_constants/margin_left = 10
theme_override_constants/margin_left = 10
[node name="edit_button" type="Button" parent="HBoxContainer/MarginContainer"]
margin_left = 10.0
margin_right = 56.0
margin_bottom = 46.0
hint_tooltip = "Edit alarm"
offset_left = 10.0
offset_right = 56.0
offset_bottom = 46.0
tooltip_text = "Edit alarm"
mouse_default_cursor_shape = 2
flat = true
[node name="HBoxContainer" type="HBoxContainer" parent="HBoxContainer/MarginContainer"]
margin_left = 10.0
margin_right = 56.0
margin_bottom = 46.0
offset_left = 10.0
offset_right = 56.0
offset_bottom = 46.0
mouse_filter = 2
custom_constants/separation = 1
theme_override_constants/separation = 1
[node name="hour" type="Label" parent="HBoxContainer/MarginContainer/HBoxContainer"]
unique_name_in_owner = true
margin_top = 12.0
margin_right = 20.0
margin_bottom = 33.0
offset_top = 12.0
offset_right = 20.0
offset_bottom = 33.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 4 )
theme_override_fonts/font = ExtResource("4")
theme_override_font_sizes/font_size = 22
text = "12"
[node name="colon" type="Label" parent="HBoxContainer/MarginContainer/HBoxContainer"]
margin_left = 21.0
margin_top = 12.0
margin_right = 25.0
margin_bottom = 33.0
offset_left = 21.0
offset_top = 12.0
offset_right = 25.0
offset_bottom = 33.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 4 )
theme_override_fonts/font = ExtResource("4")
theme_override_font_sizes/font_size = 22
text = ":"
[node name="minute" type="Label" parent="HBoxContainer/MarginContainer/HBoxContainer"]
unique_name_in_owner = true
margin_left = 26.0
margin_top = 12.0
margin_right = 46.0
margin_bottom = 33.0
offset_left = 26.0
offset_top = 12.0
offset_right = 46.0
offset_bottom = 33.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 4 )
theme_override_fonts/font = ExtResource("4")
theme_override_font_sizes/font_size = 22
text = "30"
[node name="active" type="TextureButton" parent="HBoxContainer"]
unique_name_in_owner = true
margin_left = 250.0
margin_right = 350.0
margin_bottom = 46.0
rect_min_size = Vector2( 100, 0 )
hint_tooltip = "Enable/disable alarm"
offset_left = 250.0
offset_right = 350.0
offset_bottom = 46.0
custom_minimum_size = Vector2(100, 0)
tooltip_text = "Enable/disable alarm"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 2 )
texture_pressed = ExtResource( 1 )
expand = true
button_pressed = true
texture_normal = ExtResource("2")
texture_pressed = ExtResource("1")
ignore_texture_size = true
stretch_mode = 4
[node name="ColorRect2" type="ColorRect" parent="."]
margin_top = 56.0
margin_right = 350.0
margin_bottom = 58.0
rect_min_size = Vector2( 0, 2 )
offset_top = 56.0
offset_right = 350.0
offset_bottom = 58.0
custom_minimum_size = Vector2(0, 2)
mouse_filter = 2
size_flags_horizontal = 3
color = Color( 0.25098, 0.25098, 0.25098, 0.168627 )
color = Color(0.25098, 0.25098, 0.25098, 0.168627)
[connection signal="pressed" from="HBoxContainer/delete_button" to="." method="_on_delete_button_pressed"]
[connection signal="pressed" from="HBoxContainer/MarginContainer/edit_button" to="." method="_on_edit_button_pressed"]
+13 -16
View File
@@ -2,33 +2,30 @@ extends TabContainer
const prefab := preload("res://scenes/alarms_screen/alarms_item.tscn")
onready var alarm_items = $"%alarm_items"
@onready var alarm_items = $"%alarm_items"
func _ready():
# current_tab = 1
_replace_alarm_items()
func _replace_alarm_items():
for item in alarm_items.get_children():
alarm_items.remove_child(item)
item.queue_free()
for alarm in Config.flags.alarms:
spawn_item(alarm)
func spawn_item(alarm):
var new = prefab.instance()
var new = prefab.instantiate()
new.alarm_res = alarm
new.connect("edit", self, "_on_item_edit_pressed", [new])
new.edit.connect(_on_item_edit_pressed.bind(new))
alarm_items.add_child(new)
func _on_add_button_pressed():
var new = Alarm.new()
new.moment = Constants.current_moment()
edit_alarm(new)
# if Config.flags.add_alarm(new):
# spawn_item(new)
func _on_item_edit_pressed(item):
@@ -36,10 +33,10 @@ func _on_item_edit_pressed(item):
edit_alarm(item.alarm_res)
var editing_alarm:Alarm setget edit_alarm
var editing_alarm: Alarm
func edit_alarm(new:Alarm, show_UI:=true):
print("edit alarm: ",new)
func edit_alarm(new: Alarm, show_UI: bool = true):
print("edit alarm: ", new)
editing_alarm = new
if editing_alarm:
if show_UI:
@@ -51,12 +48,12 @@ func edit_alarm(new:Alarm, show_UI:=true):
$"%alarm_weather_override".set_pressed_no_signal(new.override_weather_music)
$"%alarm_music_override_selection".select(new.weather_music)
$"%alarm_speak_time".set_pressed_no_signal(new.speak_time)
$"%customs".visible = new.play_music
$"%override_panel".visible = new.override_weather_music
func _on_alarm_play_music_toggled(button_pressed):
$"%customs".visible =button_pressed
$"%customs".visible = button_pressed
if editing_alarm:
editing_alarm.play_music = button_pressed
@@ -84,14 +81,14 @@ func _on_alarm_moment_minute_value_changed(value):
func _on_save_button_pressed():
if Config.flags.add_alarm(editing_alarm):
spawn_item(editing_alarm)
Config.emit_signal("changed")
Config.changed.emit()
editing_alarm = null
current_tab = 0
func _on_cancel_button_pressed():
editing_alarm = null
current_tab= 0
current_tab = 0
func _on_alarm_speak_time_toggled(button_pressed):
@@ -100,6 +97,6 @@ func _on_alarm_speak_time_toggled(button_pressed):
func _on_alarm_music_override_selection_selected(idx):
print("SETTING override music to ",idx," (", Constants.WEATHER.keys()[idx],')')
print("SETTING override music to ", idx, " (", Constants.WEATHER.keys()[idx], ')')
if editing_alarm:
editing_alarm.weather_music = idx
@@ -0,0 +1 @@
uid://b3fsf4f2y4v4p
+262 -260
View File
@@ -1,34 +1,34 @@
[gd_scene load_steps=22 format=2]
[gd_scene load_steps=22 format=3]
[ext_resource path="res://assets/texture/alarms/back.png" type="Texture" id=1]
[ext_resource path="res://assets/font/resource/menu_header.tres" type="DynamicFont" id=2]
[ext_resource path="res://assets/texture/alarms/add.png" type="Texture" id=3]
[ext_resource path="res://assets/texture/alarms/edit.png" type="Texture" id=4]
[ext_resource path="res://scenes/alarms_screen/alarms_screen.gd" type="Script" id=5]
[ext_resource path="res://assets/texture/alarms/set.png" type="Texture" id=6]
[ext_resource path="res://assets/texture/buttons/toggle_on.png" type="Texture" id=7]
[ext_resource path="res://assets/texture/buttons/toggle_off.png" type="Texture" id=8]
[ext_resource path="res://assets/texture/weather_icons/weather4.png" type="Texture" id=9]
[ext_resource path="res://assets/texture/weather_icons/weather8.png" type="Texture" id=10]
[ext_resource path="res://assets/texture/weather_icons/weather7.png" type="Texture" id=11]
[ext_resource path="res://assets/texture/weather_icons/weather1.png" type="Texture" id=12]
[ext_resource path="res://assets/texture/weather_icons/weather5.png" type="Texture" id=13]
[ext_resource path="res://assets/texture/weather_icons/weather3.png" type="Texture" id=14]
[ext_resource path="res://assets/texture/weather_icons/weather6.png" type="Texture" id=15]
[ext_resource path="res://assets/texture/weather_icons/weather2.png" type="Texture" id=16]
[ext_resource path="res://assets/main.tres" type="Theme" id=17]
[ext_resource path="res://scenes/alarms_screen/ButtonGroup.gd" type="Script" id=18]
[ext_resource type="Texture2D" path="res://assets/texture/alarms/back.png" id="1"]
[ext_resource type="FontVariation" path="res://assets/font/resource/menu_header.tres" id="2"]
[ext_resource type="Texture2D" path="res://assets/texture/alarms/add.png" id="3"]
[ext_resource type="Texture2D" path="res://assets/texture/alarms/edit.png" id="4"]
[ext_resource type="Script" path="res://scenes/alarms_screen/alarms_screen.gd" id="5"]
[ext_resource type="Texture2D" path="res://assets/texture/alarms/set.png" id="6"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/toggle_on.png" id="7"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/toggle_off.png" id="8"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather4.png" id="9"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather8.png" id="10"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather7.png" id="11"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather1.png" id="12"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather5.png" id="13"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather3.png" id="14"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather6.png" id="15"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather2.png" id="16"]
[ext_resource type="Theme" path="res://assets/main.tres" id="17"]
[ext_resource type="Script" path="res://scenes/alarms_screen/ButtonGroup.gd" id="18"]
[sub_resource type="StyleBoxEmpty" id=4]
[sub_resource type="StyleBoxEmpty" id="4"]
[sub_resource type="Gradient" id=3]
offsets = PoolRealArray( 0, 0.256983 )
colors = PoolColorArray( 0, 0, 0, 0.262745, 0, 0, 0, 0 )
[sub_resource type="Gradient" id="3"]
offsets = PackedFloat32Array(0, 0.256983)
colors = PackedColorArray(0, 0, 0, 0.262745, 0, 0, 0, 0)
[sub_resource type="GradientTexture2D" id=2]
gradient = SubResource( 3 )
[sub_resource type="GradientTexture2D" id="2"]
gradient = SubResource("3")
height = 32
fill_to = Vector2( 0, 1 )
fill_to = Vector2(0, 1)
[node name="alarms_screen" type="TabContainer"]
anchor_right = 1.0
@@ -36,10 +36,10 @@ anchor_bottom = 1.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 17 )
custom_styles/panel = SubResource( 4 )
theme = ExtResource("17")
theme_override_styles/panel = SubResource("4")
tabs_visible = false
script = ExtResource( 5 )
script = ExtResource("5")
[node name="main" type="VBoxContainer" parent="."]
visible = false
@@ -50,96 +50,97 @@ size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="HBoxContainer" parent="main"]
margin_right = 350.0
margin_bottom = 45.0
rect_min_size = Vector2( 0, 45 )
offset_right = 350.0
offset_bottom = 45.0
custom_minimum_size = Vector2(0, 45)
mouse_filter = 2
alignment = 1
[node name="Label" type="Label" parent="main/HBoxContainer"]
margin_left = 137.0
margin_top = 10.0
margin_right = 213.0
margin_bottom = 35.0
custom_fonts/font = ExtResource( 2 )
offset_left = 137.0
offset_top = 10.0
offset_right = 213.0
offset_bottom = 35.0
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 26
text = "ALARM"
[node name="VBoxContainer" type="MarginContainer" parent="main"]
margin_top = 49.0
margin_right = 350.0
margin_bottom = 532.0
offset_top = 49.0
offset_right = 350.0
offset_bottom = 532.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="TextureRect2" type="TextureRect" parent="main/VBoxContainer"]
margin_right = 350.0
margin_bottom = 21.0
rect_min_size = Vector2( 0, 21 )
offset_right = 350.0
offset_bottom = 21.0
custom_minimum_size = Vector2(0, 21)
mouse_filter = 2
size_flags_vertical = 0
texture = SubResource( 2 )
expand = true
stretch_mode = 2
texture = SubResource("2")
expand_mode = 1
stretch_mode = 1
[node name="ScrollContainer" type="ScrollContainer" parent="main/VBoxContainer"]
margin_right = 350.0
margin_bottom = 483.0
offset_right = 350.0
offset_bottom = 483.0
mouse_filter = 1
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
horizontal_scroll_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="main/VBoxContainer/ScrollContainer"]
margin_right = 350.0
margin_bottom = 483.0
offset_right = 350.0
offset_bottom = 483.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Control" type="Control" parent="main/VBoxContainer/ScrollContainer/VBoxContainer"]
margin_right = 350.0
margin_bottom = 20.0
rect_min_size = Vector2( 0, 20 )
offset_right = 350.0
offset_bottom = 20.0
custom_minimum_size = Vector2(0, 20)
mouse_filter = 2
[node name="alarm_items" type="VBoxContainer" parent="main/VBoxContainer/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true
margin_top = 24.0
margin_right = 350.0
margin_bottom = 483.0
offset_top = 24.0
offset_right = 350.0
offset_bottom = 483.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/separation = 0
theme_override_constants/separation = 0
[node name="HBoxContainer2" type="HBoxContainer" parent="main"]
margin_top = 536.0
margin_right = 350.0
margin_bottom = 600.0
rect_min_size = Vector2( 0, 64 )
offset_top = 536.0
offset_right = 350.0
offset_bottom = 600.0
custom_minimum_size = Vector2(0, 64)
mouse_filter = 2
[node name="edit_button" type="TextureButton" parent="main/HBoxContainer2"]
visible = false
margin_right = 173.0
margin_bottom = 64.0
offset_right = 173.0
offset_bottom = 64.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture_normal = ExtResource( 4 )
expand = true
texture_normal = ExtResource("4")
ignore_texture_size = true
stretch_mode = 5
[node name="add_button" type="TextureButton" parent="main/HBoxContainer2"]
margin_left = 177.0
margin_right = 350.0
margin_bottom = 64.0
offset_left = 177.0
offset_right = 350.0
offset_bottom = 64.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture_normal = ExtResource( 3 )
expand = true
texture_normal = ExtResource("3")
ignore_texture_size = true
stretch_mode = 5
[node name="edit" type="VBoxContainer" parent="."]
@@ -150,386 +151,387 @@ size_flags_horizontal = 3
size_flags_vertical = 3
[node name="HBoxContainer" type="MarginContainer" parent="edit"]
margin_right = 350.0
margin_bottom = 45.0
rect_min_size = Vector2( 0, 45 )
offset_right = 350.0
offset_bottom = 45.0
custom_minimum_size = Vector2(0, 45)
mouse_filter = 2
[node name="Control" type="Control" parent="edit/HBoxContainer"]
margin_right = 350.0
margin_bottom = 45.0
offset_right = 350.0
offset_bottom = 45.0
[node name="cancel_button" type="TextureButton" parent="edit/HBoxContainer/Control"]
margin_left = -8.0
margin_top = -11.0
margin_right = 121.0
margin_bottom = 60.0
rect_min_size = Vector2( 82, 0 )
offset_left = -8.0
offset_top = -11.0
offset_right = 121.0
offset_bottom = 60.0
custom_minimum_size = Vector2(82, 0)
mouse_default_cursor_shape = 2
size_flags_horizontal = 2
size_flags_vertical = 3
texture_normal = ExtResource( 1 )
expand = true
texture_normal = ExtResource("1")
ignore_texture_size = true
stretch_mode = 5
[node name="Label" type="Label" parent="edit/HBoxContainer"]
margin_top = 10.0
margin_right = 350.0
margin_bottom = 35.0
offset_top = 10.0
offset_right = 350.0
offset_bottom = 35.0
size_flags_horizontal = 3
custom_fonts/font = ExtResource( 2 )
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 26
text = "EDIT ALARM"
align = 1
horizontal_alignment = 1
[node name="VBoxContainer" type="MarginContainer" parent="edit"]
margin_top = 49.0
margin_right = 350.0
margin_bottom = 586.0
offset_top = 49.0
offset_right = 350.0
offset_bottom = 586.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="TextureRect2" type="TextureRect" parent="edit/VBoxContainer"]
margin_right = 350.0
margin_bottom = 21.0
rect_min_size = Vector2( 0, 21 )
offset_right = 350.0
offset_bottom = 21.0
custom_minimum_size = Vector2(0, 21)
mouse_filter = 2
size_flags_vertical = 0
texture = SubResource( 2 )
expand = true
stretch_mode = 2
texture = SubResource("2")
expand_mode = 1
stretch_mode = 1
[node name="ScrollContainer" type="ScrollContainer" parent="edit/VBoxContainer"]
margin_right = 350.0
margin_bottom = 537.0
scroll_horizontal_enabled = false
offset_right = 350.0
offset_bottom = 537.0
horizontal_scroll_mode = 0
[node name="VBoxContainer" type="VBoxContainer" parent="edit/VBoxContainer/ScrollContainer"]
margin_right = 350.0
margin_bottom = 537.0
rect_pivot_offset = Vector2( -731, 244 )
offset_right = 350.0
offset_bottom = 537.0
pivot_offset = Vector2(-731, 244)
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Control2" type="Control" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer"]
margin_right = 350.0
margin_bottom = 113.0
rect_min_size = Vector2( 0, 20 )
offset_right = 350.0
offset_bottom = 113.0
custom_minimum_size = Vector2(0, 20)
mouse_filter = 2
size_flags_vertical = 3
[node name="VBoxContainer" type="GridContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer"]
margin_left = 46.0
margin_top = 117.0
margin_right = 304.0
margin_bottom = 175.0
offset_left = 46.0
offset_top = 117.0
offset_right = 304.0
offset_bottom = 175.0
size_flags_horizontal = 6
columns = 2
[node name="Label" type="Label" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/VBoxContainer"]
margin_right = 127.0
margin_bottom = 22.0
offset_right = 127.0
offset_bottom = 22.0
text = "Hour "
align = 1
horizontal_alignment = 1
[node name="Label2" type="Label" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/VBoxContainer"]
margin_left = 131.0
margin_right = 258.0
margin_bottom = 22.0
offset_left = 131.0
offset_right = 258.0
offset_bottom = 22.0
text = "Minute "
align = 1
horizontal_alignment = 1
[node name="alarm_moment_hour" type="SpinBox" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/VBoxContainer"]
unique_name_in_owner = true
margin_top = 26.0
margin_right = 127.0
margin_bottom = 58.0
offset_top = 26.0
offset_right = 127.0
offset_bottom = 58.0
max_value = 23.0
[node name="alarm_moment_minute" type="SpinBox" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/VBoxContainer"]
unique_name_in_owner = true
margin_left = 131.0
margin_top = 26.0
margin_right = 258.0
margin_bottom = 58.0
offset_left = 131.0
offset_top = 26.0
offset_right = 258.0
offset_bottom = 58.0
max_value = 59.0
[node name="HBoxContainer2" type="HBoxContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer"]
margin_top = 179.0
margin_right = 350.0
margin_bottom = 236.0
offset_top = 179.0
offset_right = 350.0
offset_bottom = 236.0
[node name="Label" type="Label" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/HBoxContainer2"]
margin_top = 17.0
margin_right = 102.0
margin_bottom = 39.0
offset_top = 17.0
offset_right = 102.0
offset_bottom = 39.0
text = " Snoozable"
[node name="alarm_snoozable" type="TextureButton" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/HBoxContainer2"]
unique_name_in_owner = true
margin_left = 218.0
margin_right = 350.0
margin_bottom = 57.0
rect_min_size = Vector2( 132, 57 )
hint_tooltip = "Allow the alarm
offset_left = 218.0
offset_right = 350.0
offset_bottom = 57.0
custom_minimum_size = Vector2(132, 57)
tooltip_text = "Allow the alarm
to be snoozed
for 5 minutes"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 8 )
texture_pressed = ExtResource( 7 )
expand = true
button_pressed = true
texture_normal = ExtResource("8")
texture_pressed = ExtResource("7")
ignore_texture_size = true
stretch_mode = 4
[node name="HBoxContainer4" type="HBoxContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer"]
margin_top = 240.0
margin_right = 350.0
margin_bottom = 297.0
offset_top = 240.0
offset_right = 350.0
offset_bottom = 297.0
[node name="Label" type="Label" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/HBoxContainer4"]
margin_top = 17.0
margin_right = 114.0
margin_bottom = 39.0
offset_top = 17.0
offset_right = 114.0
offset_bottom = 39.0
text = " Speak time"
[node name="alarm_speak_time" type="TextureButton" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/HBoxContainer4"]
unique_name_in_owner = true
margin_left = 218.0
margin_right = 350.0
margin_bottom = 57.0
rect_min_size = Vector2( 132, 57 )
hint_tooltip = "Will speak the time,
offset_left = 218.0
offset_right = 350.0
offset_bottom = 57.0
custom_minimum_size = Vector2(132, 57)
tooltip_text = "Will speak the time,
day, and weather out loud"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 8 )
texture_pressed = ExtResource( 7 )
expand = true
button_pressed = true
texture_normal = ExtResource("8")
texture_pressed = ExtResource("7")
ignore_texture_size = true
stretch_mode = 4
[node name="HBoxContainer3" type="HBoxContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer"]
margin_top = 301.0
margin_right = 350.0
margin_bottom = 358.0
offset_top = 301.0
offset_right = 350.0
offset_bottom = 358.0
[node name="Label" type="Label" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/HBoxContainer3"]
margin_top = 17.0
margin_right = 111.0
margin_bottom = 39.0
offset_top = 17.0
offset_right = 111.0
offset_bottom = 39.0
text = " Play music"
[node name="alarm_play_music" type="TextureButton" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/HBoxContainer3"]
unique_name_in_owner = true
margin_left = 218.0
margin_right = 350.0
margin_bottom = 57.0
rect_min_size = Vector2( 132, 57 )
hint_tooltip = "Plays an alarm tune
offset_left = 218.0
offset_right = 350.0
offset_bottom = 57.0
custom_minimum_size = Vector2(132, 57)
tooltip_text = "Plays an alarm tune
depending on the weather
when the alarm goes off"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 8 )
texture_pressed = ExtResource( 7 )
expand = true
button_pressed = true
texture_normal = ExtResource("8")
texture_pressed = ExtResource("7")
ignore_texture_size = true
stretch_mode = 4
[node name="customs" type="VBoxContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer"]
unique_name_in_owner = true
margin_top = 362.0
margin_right = 350.0
margin_bottom = 419.0
offset_top = 362.0
offset_right = 350.0
offset_bottom = 419.0
[node name="HBoxContainer" type="HBoxContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs"]
margin_right = 350.0
margin_bottom = 57.0
offset_right = 350.0
offset_bottom = 57.0
[node name="Label" type="Label" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/HBoxContainer"]
margin_top = 17.0
margin_right = 139.0
margin_bottom = 39.0
offset_top = 17.0
offset_right = 139.0
offset_bottom = 39.0
text = " Custom music"
[node name="alarm_weather_override" type="TextureButton" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/HBoxContainer"]
unique_name_in_owner = true
margin_left = 218.0
margin_right = 350.0
margin_bottom = 57.0
rect_min_size = Vector2( 132, 57 )
hint_tooltip = "Select a specific tune to be played
offset_left = 218.0
offset_right = 350.0
offset_bottom = 57.0
custom_minimum_size = Vector2(132, 57)
tooltip_text = "Select a specific tune to be played
instead of automatically picking one
according to the weather"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
texture_normal = ExtResource( 8 )
texture_pressed = ExtResource( 7 )
expand = true
texture_normal = ExtResource("8")
texture_pressed = ExtResource("7")
ignore_texture_size = true
stretch_mode = 4
[node name="override_panel" type="PanelContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs"]
unique_name_in_owner = true
visible = false
margin_top = 61.0
margin_right = 350.0
margin_bottom = 221.0
offset_top = 61.0
offset_right = 350.0
offset_bottom = 221.0
[node name="alarm_music_override_selection" type="GridContainer" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel"]
unique_name_in_owner = true
margin_left = 15.0
margin_top = 5.0
margin_right = 335.0
margin_bottom = 155.0
rect_min_size = Vector2( 0, 150 )
offset_left = 15.0
offset_top = 5.0
offset_right = 335.0
offset_bottom = 155.0
custom_minimum_size = Vector2(0, 150)
size_flags_horizontal = 3
columns = 4
script = ExtResource( 18 )
script = ExtResource("18")
[node name="weather_cloudy" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_right = 77.0
margin_bottom = 73.0
offset_right = 77.0
offset_bottom = 73.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
icon = ExtResource( 14 )
icon_align = 1
icon = ExtResource("14")
icon_alignment = 1
expand_icon = true
[node name="weather_foggy" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_left = 81.0
margin_right = 158.0
margin_bottom = 73.0
offset_left = 81.0
offset_right = 158.0
offset_bottom = 73.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
icon = ExtResource( 11 )
icon_align = 1
icon = ExtResource("11")
icon_alignment = 1
expand_icon = true
[node name="weather_partlycloudy" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_left = 162.0
margin_right = 239.0
margin_bottom = 73.0
offset_left = 162.0
offset_right = 239.0
offset_bottom = 73.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
icon = ExtResource( 16 )
icon_align = 1
icon = ExtResource("16")
icon_alignment = 1
expand_icon = true
[node name="weather_rainy" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_left = 243.0
margin_right = 320.0
margin_bottom = 73.0
offset_left = 243.0
offset_right = 320.0
offset_bottom = 73.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
icon = ExtResource( 9 )
icon_align = 1
icon = ExtResource("9")
icon_alignment = 1
expand_icon = true
[node name="weather_snowy" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_top = 77.0
margin_right = 77.0
margin_bottom = 150.0
offset_top = 77.0
offset_right = 77.0
offset_bottom = 150.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
icon = ExtResource( 15 )
icon_align = 1
icon = ExtResource("15")
icon_alignment = 1
expand_icon = true
[node name="weather_stormy" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_left = 81.0
margin_top = 77.0
margin_right = 158.0
margin_bottom = 150.0
offset_left = 81.0
offset_top = 77.0
offset_right = 158.0
offset_bottom = 150.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
icon = ExtResource( 13 )
icon_align = 1
icon = ExtResource("13")
icon_alignment = 1
expand_icon = true
[node name="weather_sunny" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_left = 162.0
margin_top = 77.0
margin_right = 239.0
margin_bottom = 150.0
offset_left = 162.0
offset_top = 77.0
offset_right = 239.0
offset_bottom = 150.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
pressed = true
icon = ExtResource( 12 )
icon_align = 1
button_pressed = true
icon = ExtResource("12")
icon_alignment = 1
expand_icon = true
[node name="weather_unknown" type="Button" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer/customs/override_panel/alarm_music_override_selection"]
margin_left = 243.0
margin_top = 77.0
margin_right = 320.0
margin_bottom = 150.0
offset_left = 243.0
offset_top = 77.0
offset_right = 320.0
offset_bottom = 150.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme_type_variation = "SelectedItem"
theme_type_variation = &"SelectedItem"
toggle_mode = true
icon = ExtResource( 10 )
icon_align = 1
icon = ExtResource("10")
icon_alignment = 1
expand_icon = true
[node name="Control" type="Control" parent="edit/VBoxContainer/ScrollContainer/VBoxContainer"]
margin_top = 423.0
margin_right = 350.0
margin_bottom = 537.0
offset_top = 423.0
offset_right = 350.0
offset_bottom = 537.0
size_flags_vertical = 3
[node name="HBoxContainer2" type="HBoxContainer" parent="edit"]
margin_top = 590.0
margin_right = 350.0
margin_bottom = 636.0
rect_min_size = Vector2( 0, 46 )
offset_top = 590.0
offset_right = 350.0
offset_bottom = 636.0
custom_minimum_size = Vector2(0, 46)
mouse_filter = 2
[node name="save_button" type="TextureButton" parent="edit/HBoxContainer2"]
margin_right = 350.0
margin_bottom = 46.0
offset_right = 350.0
offset_bottom = 46.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture_normal = ExtResource( 6 )
expand = true
texture_normal = ExtResource("6")
ignore_texture_size = true
stretch_mode = 5
[node name="Control" type="Control" parent="edit"]
margin_top = 640.0
margin_right = 350.0
margin_bottom = 650.0
rect_min_size = Vector2( 0, 10 )
offset_top = 640.0
offset_right = 350.0
offset_bottom = 650.0
custom_minimum_size = Vector2(0, 10)
[connection signal="pressed" from="main/HBoxContainer2/add_button" to="." method="_on_add_button_pressed"]
[connection signal="pressed" from="edit/HBoxContainer/Control/cancel_button" to="." method="_on_cancel_button_pressed"]
@@ -1,20 +1,19 @@
extends HBoxContainer
onready var time_display = $VBoxContainer/time_display
onready var weather_display = $VBoxContainer/weather_display
onready var location_display = $VBoxContainer/location_display
onready var temperature_display = $VBoxContainer/temperature_display
onready var audio = $VBoxContainer/audio
@onready var time_display = $VBoxContainer/time_display
@onready var weather_display = $VBoxContainer/weather_display
@onready var location_display = $VBoxContainer/location_display
@onready var temperature_display = $VBoxContainer/temperature_display
@onready var audio = $VBoxContainer/audio
func _ready():
Config.connect("changed", self, '_on_config_changed')
Config.changed.connect(_on_config_changed)
_on_config_changed()
func _on_config_changed():
$"%location_display".text = Config.flags.location
$"%location_display".text = Config.flags.location.to_upper()
$"%time_display".use_12_hours = Config.flags.use_12_hour_clock
$"%temperature_display".show_celsius = Config.flags.show_celsius
$"%temperature_display".show_fahrenheit = Config.flags.show_fahrenheit
@@ -23,10 +22,10 @@ func _on_config_changed():
func hourly_weather_update(json):
var WC = Constants.WEATHER.UNKNOWN
var temp = 0.0
if json != null and !json.has('error'):
if json != null and json is Dictionary and !json.has('error'):
WC = json['current']['condition']['code']
temp = json['current']['temp_c']
var weather = Constants.code_to_weather(WC)
temperature_display.set_degrees_celsius(temp)
temperature_display.temperature_unknown = weather == Constants.WEATHER.UNKNOWN
@@ -0,0 +1 @@
uid://dyd1ilnxpi1q5
@@ -1,126 +1,126 @@
[gd_scene load_steps=9 format=2]
[gd_scene load_steps=9 format=3]
[ext_resource path="res://assets/font/resource/location.tres" type="DynamicFont" id=1]
[ext_resource path="res://scenes/weather_display/weather_display.tscn" type="PackedScene" id=2]
[ext_resource path="res://scenes/temperature_display/temperature_display.tscn" type="PackedScene" id=3]
[ext_resource path="res://scenes/time_display/time_display.tscn" type="PackedScene" id=4]
[ext_resource path="res://scenes/current_time_screen/current_time_screen.gd" type="Script" id=5]
[ext_resource path="res://assets/texture/buttons/audio_on.png" type="Texture" id=6]
[ext_resource path="res://assets/texture/buttons/audio_no_sound.png" type="Texture" id=7]
[ext_resource path="res://assets/texture/weather_icons/weather8.png" type="Texture" id=8]
[ext_resource type="FontVariation" path="res://assets/font/resource/location.tres" id="1"]
[ext_resource type="PackedScene" path="res://scenes/weather_display/weather_display.tscn" id="2"]
[ext_resource type="PackedScene" path="res://scenes/temperature_display/temperature_display.tscn" id="3"]
[ext_resource type="PackedScene" path="res://scenes/time_display/time_display.tscn" id="4"]
[ext_resource type="Script" path="res://scenes/current_time_screen/current_time_screen.gd" id="5"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/audio_on.png" id="6"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/audio_no_sound.png" id="7"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather8.png" id="8"]
[node name="current_time_screen" type="HBoxContainer" groups=["hourly_weather_updates", "minute_timer_updates"]]
margin_right = 350.0
margin_bottom = 600.0
offset_right = 350.0
offset_bottom = 600.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
script = ExtResource( 5 )
script = ExtResource("5")
[node name="Control3" type="Control" parent="."]
margin_right = 21.0
margin_bottom = 600.0
rect_min_size = Vector2( 0, 10 )
offset_right = 21.0
offset_bottom = 600.0
custom_minimum_size = Vector2(0, 10)
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 25.0
margin_right = 325.0
margin_bottom = 600.0
offset_left = 25.0
offset_right = 325.0
offset_bottom = 600.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_stretch_ratio = 2.0
alignment = 1
[node name="Control" type="Control" parent="VBoxContainer"]
margin_right = 300.0
margin_bottom = 62.0
rect_min_size = Vector2( 0, 10 )
offset_right = 300.0
offset_bottom = 62.0
custom_minimum_size = Vector2(0, 10)
mouse_filter = 2
size_flags_vertical = 3
[node name="time_display" parent="VBoxContainer" instance=ExtResource( 4 )]
[node name="time_display" parent="VBoxContainer" instance=ExtResource("4")]
unique_name_in_owner = true
margin_left = 27.0
margin_top = 66.0
margin_right = 273.0
margin_bottom = 155.0
offset_left = 27.0
offset_top = 66.0
offset_right = 273.0
offset_bottom = 155.0
mouse_filter = 2
size_flags_horizontal = 4
[node name="weather_display" parent="VBoxContainer" instance=ExtResource( 2 )]
[node name="weather_display" parent="VBoxContainer" instance=ExtResource("2")]
unique_name_in_owner = true
margin_left = 0.0
margin_top = 159.0
margin_right = 300.0
margin_bottom = 359.0
rect_min_size = Vector2( 300, 200 )
offset_left = 0.0
offset_top = 159.0
offset_right = 300.0
offset_bottom = 359.0
custom_minimum_size = Vector2(300, 200)
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
size_flags_stretch_ratio = 3.0
texture = ExtResource( 8 )
expand = true
stretch_mode = 6
texture = ExtResource("8")
expand_mode = 1
stretch_mode = 5
weather = 7
[node name="location_display" type="Label" parent="VBoxContainer"]
unique_name_in_owner = true
margin_top = 363.0
margin_right = 300.0
margin_bottom = 383.0
custom_fonts/font = ExtResource( 1 )
text = "Amsterdam"
align = 1
uppercase = true
offset_top = 363.0
offset_right = 300.0
offset_bottom = 383.0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 21
text = "AMSTERDAM"
horizontal_alignment = 1
[node name="temperature_display" parent="VBoxContainer" instance=ExtResource( 3 )]
[node name="temperature_display" parent="VBoxContainer" instance=ExtResource("3")]
unique_name_in_owner = true
margin_top = 387.0
margin_right = 300.0
margin_bottom = 423.0
offset_top = 387.0
offset_right = 300.0
offset_bottom = 423.0
mouse_filter = 2
[node name="Control2" type="Control" parent="VBoxContainer"]
margin_top = 427.0
margin_right = 300.0
margin_bottom = 489.0
rect_min_size = Vector2( 0, 10 )
offset_top = 427.0
offset_right = 300.0
offset_bottom = 489.0
custom_minimum_size = Vector2(0, 10)
mouse_filter = 2
size_flags_vertical = 3
[node name="audio" type="TextureButton" parent="VBoxContainer"]
margin_left = 130.0
margin_top = 493.0
margin_right = 170.0
margin_bottom = 533.0
rect_min_size = Vector2( 40, 40 )
hint_tooltip = "Speak time and
offset_left = 130.0
offset_top = 493.0
offset_right = 170.0
offset_bottom = 533.0
custom_minimum_size = Vector2(40, 40)
tooltip_text = "Speak time and
weather out loud"
mouse_default_cursor_shape = 2
size_flags_horizontal = 4
toggle_mode = true
texture_normal = ExtResource( 7 )
texture_pressed = ExtResource( 6 )
expand = true
texture_normal = ExtResource("7")
texture_pressed = ExtResource("6")
ignore_texture_size = true
stretch_mode = 5
[node name="Control3" type="Control" parent="VBoxContainer"]
margin_top = 537.0
margin_right = 300.0
margin_bottom = 600.0
rect_min_size = Vector2( 0, 10 )
offset_top = 537.0
offset_right = 300.0
offset_bottom = 600.0
custom_minimum_size = Vector2(0, 10)
mouse_filter = 2
size_flags_vertical = 3
[node name="Control4" type="Control" parent="."]
margin_left = 329.0
margin_right = 350.0
margin_bottom = 600.0
rect_min_size = Vector2( 0, 10 )
offset_left = 329.0
offset_right = 350.0
offset_bottom = 600.0
custom_minimum_size = Vector2(0, 10)
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
@@ -0,0 +1 @@
uid://cig6jhhr0ckfo
+9 -9
View File
@@ -1,18 +1,18 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=3 format=3]
[ext_resource path="res://scenes/time_display/time_display.tscn" type="PackedScene" id=1]
[ext_resource path="res://scenes/debug/current_time/current_time.gd" type="Script" id=2]
[ext_resource type="PackedScene" path="res://scenes/time_display/time_display.tscn" id="1"]
[ext_resource type="Script" path="res://scenes/debug/current_time/current_time.gd" id="2"]
[node name="Control" type="CenterContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
script = ExtResource("2")
[node name="time_display" parent="." instance=ExtResource( 1 )]
margin_left = 395.0
margin_top = 255.0
margin_right = 629.0
margin_bottom = 344.0
[node name="time_display" parent="." instance=ExtResource("1")]
offset_left = 395.0
offset_top = 255.0
offset_right = 629.0
offset_bottom = 344.0
[node name="Timer" type="Timer" parent="."]
wait_time = 30.0
+2 -4
View File
@@ -2,13 +2,11 @@ extends Control
func _ready():
var stuff = yield($WeatherAPINode.get_current(), "completed")
var out = JSON.print(stuff, " ")
var stuff = await $WeatherAPINode.get_current()
var out = JSON.stringify(stuff, " ")
$RichTextLabel.text = out
var WC = str(stuff['current']['condition']['code'])
print([WC])
print(Constants.weather_codes)
print(Constants.weather_codes.has(WC))
print(Constants.WEATHER.keys()[Constants.code_to_weather(WC)])
@@ -0,0 +1 @@
uid://c2s7mgf5ote6d
+5 -5
View File
@@ -1,15 +1,15 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=3 format=3]
[ext_resource path="res://addons/WeatherAPI/node.gd" type="Script" id=1]
[ext_resource path="res://scenes/debug/weatherapi/weatherapi.gd" type="Script" id=2]
[ext_resource type="Script" path="res://addons/WeatherAPI/node.gd" id="1"]
[ext_resource type="Script" path="res://scenes/debug/weatherapi/weatherapi.gd" id="2"]
[node name="weatherapi" type="Control"]
anchor_right = 1.0
anchor_bottom = 1.0
script = ExtResource( 2 )
script = ExtResource("2")
[node name="WeatherAPINode" type="Node" parent="."]
script = ExtResource( 1 )
script = ExtResource("1")
[node name="RichTextLabel" type="RichTextLabel" parent="."]
anchor_right = 1.0
+15 -17
View File
@@ -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():
+1
View File
@@ -0,0 +1 @@
uid://cins64joste5c
+32 -32
View File
@@ -1,14 +1,14 @@
extends MarginContainer
onready var tab_buttons = $"%tab_buttons"
onready var weather_api_node = $WeatherAPINode
@onready var tab_buttons = $"%tab_buttons"
@onready var weather_api_node = $WeatherAPINode
onready var backgrounds = get_tree().get_nodes_in_group("background")
onready var foreground = $foreground
onready var screens = $"%screens"
onready var time_talker = $"time talker"
onready var sleep_mode = $sleep_mode
onready var minute_timer = $"minute timer"
@onready var backgrounds = get_tree().get_nodes_in_group("background")
@onready var foreground = $foreground
@onready var screens = $"%screens"
@onready var time_talker = $"time talker"
@onready var sleep_mode = $sleep_mode
@onready var minute_timer = $"minute timer"
const version := '1.0'
const linkbacks := true
@@ -21,11 +21,15 @@ func _ready():
get_tree().call_group("linkbacks", "hide")
get_tree().call_group("linkbacks", "set_text", '')
if OS.get_name() in ['Android', 'iOS']:
var win = get_window()
win.content_scale_mode = Window.CONTENT_SCALE_MODE_CANVAS_ITEMS
win.content_scale_aspect = Window.CONTENT_SCALE_ASPECT_EXPAND
win.content_scale_size = Vector2i(
ProjectSettings.get_setting("display/window/size/viewport_width"),
ProjectSettings.get_setting("display/window/size/viewport_height"))
if OS.get_name() in ['Android', 'IOS']:
get_tree().set_screen_stretch( SceneTree.STRETCH_MODE_2D, SceneTree.STRETCH_ASPECT_EXPAND, Vector2(ProjectSettings.get_setting("display/window/size/width"), ProjectSettings.get_setting("display/window/size/height")))
Config.connect("changed", self, "_on_config_changed")
Config.changed.connect(_on_config_changed)
_on_config_changed(true)
print(screens)
audio_button = screens.tabs_holder.get_child(0).audio
@@ -34,11 +38,11 @@ func _ready():
_on_hourly_weather_timer_timeout()
_on_minute_timer_timeout()
var seconds = Time.get_time_dict_from_system()['second']
minute_timer.start(60-seconds)
minute_timer.start(60 - seconds)
func _on_config_changed(skip_api_update:=false):
func _on_config_changed(skip_api_update: bool = false):
if !skip_api_update and (weather_api_node.location != Config.flags.location or weather_api_node.api_key != Config.flags.api_key):
weather_api_node.api_key = Config.flags.api_key
weather_api_node.location = Config.flags.location
@@ -54,16 +58,16 @@ func _on_TabContainer_tab_selected(tab):
if !tab_buttons:
return
for item in tab_buttons.get_children():
item.pressed = x == tab
item.button_pressed = x == tab
x += 1
func _notification(what):
if what == NOTIFICATION_WM_QUIT_REQUEST or what == NOTIFICATION_APP_PAUSED or what == NOTIFICATION_WM_FOCUS_OUT:
if what == NOTIFICATION_WM_CLOSE_REQUEST or what == NOTIFICATION_APPLICATION_PAUSED or what == NOTIFICATION_APPLICATION_FOCUS_OUT:
Config.save_flags()
if what == NOTIFICATION_WM_QUIT_REQUEST:
if what == NOTIFICATION_WM_CLOSE_REQUEST:
get_tree().quit()
func tween_background(color:Color, duration := 0.75):
func tween_background(color: Color, duration: float = 0.75):
for background in backgrounds:
var tween = get_tree().create_tween()
tween.tween_property(background, 'color', color, duration)
@@ -74,36 +78,35 @@ func _on_hourly_weather_timer_timeout():
func _on_WeatherAPINode_received_forecast(json):
var WC = Constants.WEATHER.UNKNOWN
print('weather update: ',json)
if json != null and not json.get('error'):
print('weather update: ', json)
if json != null and json is Dictionary and not json.get('error'):
weather_data.append(json)
WC = json['current']['condition']['code']
get_tree().call_group("hourly_weather_updates", "hourly_weather_update", json)
var weather = Constants.code_to_weather(WC)
tween_background(Constants.weather_to_color(weather))
func set_transition(stage:float):
foreground.material.set_shader_param('transition', stage)
func set_transition(stage: float):
foreground.material.set_shader_parameter('transition', stage)
func _on_minute_timer_timeout():
var time = Time.get_time_dict_from_system()
get_tree().call_group("minute_timer_updates", "minute_timer_update", time)
_check_dark_mode(time)
minute_timer.start(60.0)
func _check_dark_mode(time):
var ctrans = foreground.material.get_shader_param('transition')
var ctrans = foreground.material.get_shader_parameter('transition')
var target = 0.0
if Config.flags.automatic_dark_mode and (time['hour'] >= 20 or time['hour'] <= 6):
print('go')
target = 1.0
if ctrans != target:
var tween = get_tree().create_tween()
tween.tween_method(self, "set_transition", 1.0-target, target, 2.0)
tween.tween_method(set_transition, 1.0 - target, target, 2.0)
tween.play()
func _on_audio_toggled(button_pressed):
if button_pressed:
var weather = Constants.WEATHER.UNKNOWN
@@ -115,21 +118,18 @@ func _on_audio_toggled(button_pressed):
func _on_time_talker_finished():
pass # Replace with function body.
audio_button.pressed = false
audio_button.button_pressed = false
func _on_hide_sleepmode_pressed():
sleep_mode.hide()
func _on_tab_button_pressed(idx:int):
func _on_tab_button_pressed(idx: int):
if screens:
screens.switch_tab(idx)
func _on_credits_button_pressed():
if linkbacks:
OS.shell_open("https://lisanne.gay/")
+1
View File
@@ -0,0 +1 @@
uid://dhutm786peqfq
+211 -307
View File
@@ -1,144 +1,54 @@
[gd_scene load_steps=37 format=2]
[gd_scene load_steps=30 format=3]
[ext_resource path="res://assets/texture/buttons/clock.png" type="Texture" id=1]
[ext_resource path="res://assets/texture/buttons/clock_on.png" type="Texture" id=2]
[ext_resource path="res://assets/texture/buttons/time.png" type="Texture" id=3]
[ext_resource path="res://scenes/current_time_screen/current_time_screen.tscn" type="PackedScene" id=4]
[ext_resource path="res://assets/texture/buttons/globe.png" type="Texture" id=5]
[ext_resource path="res://assets/texture/buttons/globe_on.png" type="Texture" id=6]
[ext_resource path="res://assets/texture/buttons/time_on.png" type="Texture" id=7]
[ext_resource path="res://scenes/main/main.gd" type="Script" id=8]
[ext_resource path="res://addons/WeatherAPI/node.gd" type="Script" id=9]
[ext_resource path="res://scripts/AudioArrayPlayer.gd" type="Script" id=10]
[ext_resource path="res://scenes/main/time talker.gd" type="Script" id=11]
[ext_resource path="res://assets/texture/buttons/settings.png" type="Texture" id=12]
[ext_resource path="res://assets/texture/buttons/settings_on.png" type="Texture" id=13]
[ext_resource path="res://assets/texture/buttons/time_hover.png" type="Texture" id=14]
[ext_resource path="res://assets/texture/buttons/globe_hover.png" type="Texture" id=15]
[ext_resource path="res://assets/texture/buttons/clock_hover.png" type="Texture" id=16]
[ext_resource path="res://assets/texture/buttons/settings_hover.png" type="Texture" id=17]
[ext_resource path="res://assets/main.tres" type="Theme" id=18]
[ext_resource path="res://addons/BetterTabContainer/BetterTabContainer.gd" type="Script" id=19]
[ext_resource path="res://assets/texture/buttons/moon.png" type="Texture" id=20]
[ext_resource path="res://scenes/alarms_screen/alarms_screen.tscn" type="PackedScene" id=21]
[ext_resource path="res://scenes/main/sleep_mode.gd" type="Script" id=22]
[ext_resource path="res://assets/texture/alarms/cancel.png" type="Texture" id=23]
[ext_resource path="res://assets/texture/alarms/wakeup.png" type="Texture" id=24]
[ext_resource path="res://scenes/main/alarm.gd" type="Script" id=25]
[ext_resource path="res://scenes/settings_screen/settings_screen.tscn" type="PackedScene" id=26]
[ext_resource path="res://icon.png" type="Texture" id=27]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/clock.png" id="1"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/clock_on.png" id="2"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/time.png" id="3"]
[ext_resource type="PackedScene" path="res://scenes/current_time_screen/current_time_screen.tscn" id="4"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/globe.png" id="5"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/globe_on.png" id="6"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/time_on.png" id="7"]
[ext_resource type="Script" path="res://scenes/main/main.gd" id="8"]
[ext_resource type="Script" path="res://addons/WeatherAPI/node.gd" id="9"]
[ext_resource type="Script" path="res://scripts/AudioArrayPlayer.gd" id="10"]
[ext_resource type="Script" path="res://scenes/main/time talker.gd" id="11"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/settings.png" id="12"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/settings_on.png" id="13"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/time_hover.png" id="14"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/globe_hover.png" id="15"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/clock_hover.png" id="16"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/settings_hover.png" id="17"]
[ext_resource type="Theme" path="res://assets/main.tres" id="18"]
[ext_resource type="Script" path="res://addons/BetterTabContainer/BetterTabContainer.gd" id="19"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/moon.png" id="20"]
[ext_resource type="PackedScene" path="res://scenes/alarms_screen/alarms_screen.tscn" id="21"]
[ext_resource type="Script" path="res://scenes/main/sleep_mode.gd" id="22"]
[ext_resource type="Texture2D" path="res://assets/texture/alarms/cancel.png" id="23"]
[ext_resource type="Texture2D" path="res://assets/texture/alarms/wakeup.png" id="24"]
[ext_resource type="Script" path="res://scenes/main/alarm.gd" id="25"]
[ext_resource type="PackedScene" path="res://scenes/settings_screen/settings_screen.tscn" id="26"]
[ext_resource type="Texture2D" path="res://icon.png" id="27"]
[ext_resource type="Shader" path="res://assets/foreground_invert.gdshader" id="28"]
[sub_resource type="VisualShaderNodeInput" id=5]
input_name = "screen_texture"
[sub_resource type="VisualShaderNodeTexture" id=6]
source = 5
[sub_resource type="VisualShaderNodeInput" id=7]
input_name = "screen_uv"
[sub_resource type="VisualShaderNodeVectorOp" id=8]
default_input_values = [ 0, Vector3( 1, 1, 1 ), 1, Vector3( 0, 0, 0 ) ]
operator = 1
[sub_resource type="VisualShaderNodeVectorInterp" id=9]
[sub_resource type="VisualShaderNodeScalarConstant" id=10]
constant = 1.0
[sub_resource type="VisualShaderNodeScalarUniform" id=11]
uniform_name = "transition"
hint = 1
default_value_enabled = true
[sub_resource type="VisualShader" id=3]
code = "shader_type canvas_item;
uniform float transition : hint_range(0, 1) = 0;
void vertex() {
// Output:0
}
void fragment() {
// Input:4
vec3 n_out4p0 = vec3(SCREEN_UV, 0.0);
// Input:2
// Texture:3
vec3 n_out3p0;
float n_out3p1;
{
vec4 SCREEN_TEXTURE_tex_read = texture(SCREEN_TEXTURE, n_out4p0.xy);
n_out3p0 = SCREEN_TEXTURE_tex_read.rgb;
n_out3p1 = SCREEN_TEXTURE_tex_read.a;
}
// Scalar:7
float n_out7p0 = 1.000000;
// VectorOp:5
vec3 n_out5p0 = vec3(n_out7p0) - n_out3p0;
// ScalarUniform:8
float n_out8p0 = transition;
// VectorMix:6
vec3 n_out6p0 = mix(n_out3p0, n_out5p0, vec3(n_out8p0));
// Output:0
COLOR.rgb = n_out6p0;
}
void light() {
// Output:0
}
"
graph_offset = Vector2( -259.29, 244.334 )
mode = 1
flags/light_only = false
nodes/fragment/0/position = Vector2( 760, 120 )
nodes/fragment/2/node = SubResource( 5 )
nodes/fragment/2/position = Vector2( -180, 200 )
nodes/fragment/3/node = SubResource( 6 )
nodes/fragment/3/position = Vector2( 80, 120 )
nodes/fragment/4/node = SubResource( 7 )
nodes/fragment/4/position = Vector2( -180, 140 )
nodes/fragment/5/node = SubResource( 8 )
nodes/fragment/5/position = Vector2( 280, 100 )
nodes/fragment/6/node = SubResource( 9 )
nodes/fragment/6/position = Vector2( 520, 140 )
nodes/fragment/7/node = SubResource( 10 )
nodes/fragment/7/position = Vector2( 80, 60 )
nodes/fragment/8/node = SubResource( 11 )
nodes/fragment/8/position = Vector2( 200, 260 )
nodes/fragment/connections = PoolIntArray( 2, 0, 3, 2, 4, 0, 3, 0, 3, 0, 5, 1, 7, 0, 5, 0, 6, 0, 0, 0, 8, 0, 6, 2, 5, 0, 6, 1, 3, 0, 6, 0 )
[sub_resource type="ShaderMaterial" id=4]
shader = SubResource( 3 )
shader_param/transition = 0.0
[sub_resource type="ShaderMaterial" id="4"]
shader = ExtResource("28")
shader_parameter/transition = 0.0
[node name="main" type="MarginContainer"]
anchor_right = 1.0
anchor_bottom = 1.0
mouse_filter = 2
theme = ExtResource( 18 )
script = ExtResource( 8 )
theme = ExtResource("18")
script = ExtResource("8")
[node name="background" type="ColorRect" parent="." groups=["background"]]
margin_right = 350.0
margin_bottom = 650.0
offset_right = 350.0
offset_bottom = 650.0
mouse_filter = 2
color = Color( 0.815686, 0.815686, 0.815686, 1 )
color = Color(0.815686, 0.815686, 0.815686, 1)
[node name="TabContainer" type="TabContainer" parent="."]
margin_right = 350.0
margin_bottom = 650.0
offset_right = 350.0
offset_bottom = 650.0
tabs_visible = false
[node name="VBoxContainer" type="VBoxContainer" parent="TabContainer"]
@@ -150,105 +60,105 @@ size_flags_vertical = 3
[node name="screens" type="ScrollContainer" parent="TabContainer/VBoxContainer"]
unique_name_in_owner = true
margin_right = 350.0
margin_bottom = 582.0
offset_right = 350.0
offset_bottom = 582.0
size_flags_horizontal = 3
size_flags_vertical = 3
script = ExtResource( 19 )
script = ExtResource("19")
swipe_threshold = 32.0
[node name="current_time_screen" parent="TabContainer/VBoxContainer/screens" instance=ExtResource( 4 )]
margin_bottom = 582.0
[node name="current_time_screen" parent="TabContainer/VBoxContainer/screens" instance=ExtResource("4")]
offset_bottom = 582.0
[node name="Control3" parent="TabContainer/VBoxContainer/screens/current_time_screen" index="0"]
margin_bottom = 582.0
offset_bottom = 582.0
[node name="VBoxContainer" parent="TabContainer/VBoxContainer/screens/current_time_screen" index="1"]
margin_bottom = 582.0
offset_bottom = 582.0
[node name="Control" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="0"]
margin_bottom = 56.0
offset_bottom = 56.0
[node name="time_display" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="1"]
margin_top = 60.0
margin_bottom = 149.0
offset_top = 60.0
offset_bottom = 149.0
[node name="weather_display" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="2"]
margin_top = 153.0
margin_bottom = 353.0
offset_top = 153.0
offset_bottom = 353.0
[node name="location_display" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="3"]
margin_top = 357.0
margin_bottom = 377.0
offset_top = 357.0
offset_bottom = 377.0
[node name="temperature_display" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="4"]
margin_top = 381.0
margin_bottom = 417.0
offset_top = 381.0
offset_bottom = 417.0
[node name="Control2" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="5"]
margin_top = 421.0
margin_bottom = 477.0
offset_top = 421.0
offset_bottom = 477.0
[node name="audio" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="6"]
margin_top = 481.0
margin_bottom = 521.0
offset_top = 481.0
offset_bottom = 521.0
[node name="Control3" parent="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer" index="7"]
margin_top = 525.0
margin_bottom = 582.0
offset_top = 525.0
offset_bottom = 582.0
[node name="Control4" parent="TabContainer/VBoxContainer/screens/current_time_screen" index="2"]
margin_bottom = 582.0
offset_bottom = 582.0
[node name="alarms_screen" parent="TabContainer/VBoxContainer/screens" instance=ExtResource( 21 )]
[node name="alarms_screen" parent="TabContainer/VBoxContainer/screens" instance=ExtResource("21")]
anchor_right = 0.0
anchor_bottom = 0.0
margin_right = 350.0
margin_bottom = 582.0
offset_right = 350.0
offset_bottom = 582.0
[node name="globe_screen" type="ScrollContainer" parent="TabContainer/VBoxContainer/screens"]
margin_right = 304.0
offset_right = 304.0
mouse_filter = 2
scroll_horizontal_enabled = false
horizontal_scroll_mode = 0
[node name="globe_screen" type="VBoxContainer" parent="TabContainer/VBoxContainer/screens/globe_screen"]
margin_right = 288.0
margin_bottom = 528.0
offset_right = 288.0
offset_bottom = 528.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
alignment = 1
[node name="MarginContainer" type="MarginContainer" parent="TabContainer/VBoxContainer/screens/globe_screen/globe_screen"]
margin_right = 288.0
margin_bottom = 300.0
offset_right = 288.0
offset_bottom = 300.0
mouse_filter = 2
size_flags_horizontal = 3
custom_constants/margin_right = 25
custom_constants/margin_left = 25
theme_override_constants/margin_right = 25
theme_override_constants/margin_left = 25
[node name="TextureRect" type="TextureRect" parent="TabContainer/VBoxContainer/screens/globe_screen/globe_screen/MarginContainer"]
margin_left = 25.0
margin_right = 263.0
margin_bottom = 300.0
rect_min_size = Vector2( 0, 300 )
offset_left = 25.0
offset_right = 263.0
offset_bottom = 300.0
custom_minimum_size = Vector2(0, 300)
mouse_filter = 2
size_flags_horizontal = 3
texture = ExtResource( 27 )
expand = true
stretch_mode = 6
texture = ExtResource("27")
expand_mode = 1
stretch_mode = 5
[node name="version" type="Label" parent="TabContainer/VBoxContainer/screens/globe_screen/globe_screen"]
margin_top = 304.0
margin_right = 288.0
margin_bottom = 326.0
offset_top = 304.0
offset_right = 288.0
offset_bottom = 326.0
text = "UNIQLONE v1.0"
align = 1
horizontal_alignment = 1
[node name="credits" type="Label" parent="TabContainer/VBoxContainer/screens/globe_screen/globe_screen" groups=["linkbacks"]]
margin_top = 330.0
margin_right = 288.0
margin_bottom = 502.0
offset_top = 330.0
offset_right = 288.0
offset_bottom = 502.0
text = "
Made by (lis)anne
Original app & assets by UNIQLO
@@ -256,173 +166,173 @@ Created in Godot engine
Name by @Sneakilli
BetterTabContainer by Ucrash
"
align = 1
horizontal_alignment = 1
[node name="credits_button" type="LinkButton" parent="TabContainer/VBoxContainer/screens/globe_screen/globe_screen" groups=["linkbacks"]]
margin_left = 30.0
margin_top = 506.0
margin_right = 257.0
margin_bottom = 528.0
offset_left = 30.0
offset_top = 506.0
offset_right = 257.0
offset_bottom = 528.0
size_flags_horizontal = 4
custom_colors/font_color = Color( 0, 0, 0, 1 )
theme_override_colors/font_color = Color(0, 0, 0, 1)
text = "Check out my other stuff"
[node name="settings_screen" parent="TabContainer/VBoxContainer/screens" instance=ExtResource( 26 )]
margin_bottom = 582.0
[node name="settings_screen" parent="TabContainer/VBoxContainer/screens" instance=ExtResource("26")]
offset_bottom = 582.0
[node name="tab_buttons" type="HBoxContainer" parent="TabContainer/VBoxContainer"]
unique_name_in_owner = true
margin_top = 586.0
margin_right = 350.0
margin_bottom = 636.0
rect_min_size = Vector2( 0, 50 )
offset_top = 586.0
offset_right = 350.0
offset_bottom = 636.0
custom_minimum_size = Vector2(0, 50)
[node name="current_button" type="TextureButton" parent="TabContainer/VBoxContainer/tab_buttons"]
margin_right = 84.0
margin_bottom = 50.0
offset_right = 84.0
offset_bottom = 50.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 3 )
texture_pressed = ExtResource( 7 )
texture_hover = ExtResource( 14 )
expand = true
button_pressed = true
texture_normal = ExtResource("3")
texture_pressed = ExtResource("7")
texture_hover = ExtResource("14")
ignore_texture_size = true
stretch_mode = 5
[node name="alarms_button" type="TextureButton" parent="TabContainer/VBoxContainer/tab_buttons"]
margin_left = 88.0
margin_right = 173.0
margin_bottom = 50.0
offset_left = 88.0
offset_right = 173.0
offset_bottom = 50.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
toggle_mode = true
texture_normal = ExtResource( 1 )
texture_pressed = ExtResource( 2 )
texture_hover = ExtResource( 16 )
expand = true
texture_normal = ExtResource("1")
texture_pressed = ExtResource("2")
texture_hover = ExtResource("16")
ignore_texture_size = true
stretch_mode = 5
[node name="globe_button" type="TextureButton" parent="TabContainer/VBoxContainer/tab_buttons"]
margin_left = 177.0
margin_right = 261.0
margin_bottom = 50.0
offset_left = 177.0
offset_right = 261.0
offset_bottom = 50.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
toggle_mode = true
texture_normal = ExtResource( 5 )
texture_pressed = ExtResource( 6 )
texture_hover = ExtResource( 15 )
expand = true
texture_normal = ExtResource("5")
texture_pressed = ExtResource("6")
texture_hover = ExtResource("15")
ignore_texture_size = true
stretch_mode = 5
[node name="settings_button" type="TextureButton" parent="TabContainer/VBoxContainer/tab_buttons"]
margin_left = 265.0
margin_right = 350.0
margin_bottom = 50.0
offset_left = 265.0
offset_right = 350.0
offset_bottom = 50.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
toggle_mode = true
texture_normal = ExtResource( 12 )
texture_pressed = ExtResource( 13 )
texture_hover = ExtResource( 17 )
expand = true
texture_normal = ExtResource("12")
texture_pressed = ExtResource("13")
texture_hover = ExtResource("17")
ignore_texture_size = true
stretch_mode = 5
[node name="Control" type="Control" parent="TabContainer/VBoxContainer"]
margin_top = 640.0
margin_right = 350.0
margin_bottom = 650.0
rect_min_size = Vector2( 0, 10 )
offset_top = 640.0
offset_right = 350.0
offset_bottom = 650.0
custom_minimum_size = Vector2(0, 10)
[node name="alarm" type="MarginContainer" parent="."]
visible = false
margin_right = 350.0
margin_bottom = 650.0
script = ExtResource( 25 )
offset_right = 350.0
offset_bottom = 650.0
script = ExtResource("25")
[node name="background" type="ColorRect" parent="alarm" groups=["background"]]
margin_right = 350.0
margin_bottom = 650.0
offset_right = 350.0
offset_bottom = 650.0
mouse_filter = 2
color = Color( 0.815686, 0.815686, 0.815686, 1 )
color = Color(0.815686, 0.815686, 0.815686, 1)
[node name="VBoxContainer" type="VBoxContainer" parent="alarm"]
margin_right = 350.0
margin_bottom = 650.0
offset_right = 350.0
offset_bottom = 650.0
[node name="current_time_screen" parent="alarm/VBoxContainer" instance=ExtResource( 4 )]
margin_bottom = 532.0
[node name="current_time_screen" parent="alarm/VBoxContainer" instance=ExtResource("4")]
offset_bottom = 532.0
[node name="Control3" parent="alarm/VBoxContainer/current_time_screen" index="0"]
margin_bottom = 532.0
offset_bottom = 532.0
[node name="VBoxContainer" parent="alarm/VBoxContainer/current_time_screen" index="1"]
margin_bottom = 532.0
offset_bottom = 532.0
[node name="Control" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="0"]
margin_bottom = 72.0
offset_bottom = 72.0
[node name="TextureRect" type="TextureRect" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="1"]
margin_top = 76.0
margin_right = 300.0
margin_bottom = 76.0
offset_top = 76.0
offset_right = 300.0
offset_bottom = 76.0
[node name="time_display" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="2"]
margin_top = 80.0
margin_bottom = 169.0
offset_top = 80.0
offset_bottom = 169.0
[node name="weather_display" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="3"]
margin_top = 173.0
margin_bottom = 391.0
offset_top = 173.0
offset_bottom = 391.0
[node name="location_display" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="4"]
margin_top = 395.0
margin_bottom = 415.0
offset_top = 395.0
offset_bottom = 415.0
[node name="temperature_display" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="5"]
margin_top = 419.0
margin_bottom = 455.0
offset_top = 419.0
offset_bottom = 455.0
[node name="Control2" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="6"]
margin_top = 459.0
margin_bottom = 532.0
offset_top = 459.0
offset_bottom = 532.0
[node name="audio" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="7"]
visible = false
[node name="Control3" parent="alarm/VBoxContainer/current_time_screen/VBoxContainer" index="8"]
visible = false
margin_top = 528.0
offset_top = 528.0
[node name="Control4" parent="alarm/VBoxContainer/current_time_screen" index="2"]
margin_bottom = 532.0
offset_bottom = 532.0
[node name="HBoxContainer" type="HBoxContainer" parent="alarm/VBoxContainer"]
margin_top = 536.0
margin_right = 350.0
margin_bottom = 600.0
rect_min_size = Vector2( 0, 64 )
offset_top = 536.0
offset_right = 350.0
offset_bottom = 600.0
custom_minimum_size = Vector2(0, 64)
[node name="snooze" type="TextureButton" parent="alarm/VBoxContainer/HBoxContainer"]
margin_right = 173.0
margin_bottom = 64.0
offset_right = 173.0
offset_bottom = 64.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture_normal = ExtResource( 23 )
expand = true
texture_normal = ExtResource("23")
ignore_texture_size = true
stretch_mode = 5
[node name="stop" type="TextureButton" parent="alarm/VBoxContainer/HBoxContainer"]
margin_left = 177.0
margin_right = 350.0
margin_bottom = 64.0
offset_left = 177.0
offset_right = 350.0
offset_bottom = 64.0
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
size_flags_vertical = 3
texture_normal = ExtResource( 24 )
expand = true
texture_normal = ExtResource("24")
ignore_texture_size = true
stretch_mode = 5
[node name="snooze timer" type="Timer" parent="alarm"]
@@ -430,66 +340,60 @@ wait_time = 300.0
one_shot = true
[node name="foreground" type="ColorRect" parent="."]
material = SubResource( 4 )
margin_right = 350.0
margin_bottom = 650.0
material = SubResource("4")
offset_right = 350.0
offset_bottom = 650.0
mouse_filter = 2
__meta__ = {
"_edit_lock_": true
}
[node name="sleep_mode" type="MarginContainer" parent="." groups=["minute_timer_updates"]]
visible = false
margin_right = 350.0
margin_bottom = 650.0
offset_right = 350.0
offset_bottom = 650.0
mouse_default_cursor_shape = 2
script = ExtResource( 22 )
__meta__ = {
"_edit_lock_": true
}
script = ExtResource("22")
[node name="ColorRect" type="ColorRect" parent="sleep_mode"]
margin_right = 350.0
margin_bottom = 650.0
color = Color( 0, 0, 0, 1 )
offset_right = 350.0
offset_bottom = 650.0
color = Color(0, 0, 0, 1)
[node name="CenterContainer" type="CenterContainer" parent="sleep_mode"]
margin_right = 350.0
margin_bottom = 650.0
offset_right = 350.0
offset_bottom = 650.0
[node name="VBoxContainer" type="VBoxContainer" parent="sleep_mode/CenterContainer"]
modulate = Color( 1, 1, 1, 0.47451 )
margin_left = 128.0
margin_top = 267.0
margin_right = 221.0
margin_bottom = 383.0
modulate = Color(1, 1, 1, 0.47451)
offset_left = 128.0
offset_top = 267.0
offset_right = 221.0
offset_bottom = 383.0
[node name="TextureRect" type="TextureRect" parent="sleep_mode/CenterContainer/VBoxContainer"]
margin_right = 93.0
margin_bottom = 64.0
rect_min_size = Vector2( 64, 64 )
texture = ExtResource( 20 )
expand = true
stretch_mode = 6
offset_right = 93.0
offset_bottom = 64.0
custom_minimum_size = Vector2(64, 64)
texture = ExtResource("20")
expand_mode = 1
stretch_mode = 5
[node name="Label" type="Label" parent="sleep_mode/CenterContainer/VBoxContainer"]
margin_top = 68.0
margin_right = 93.0
margin_bottom = 90.0
offset_top = 68.0
offset_right = 93.0
offset_bottom = 90.0
text = "Good night"
align = 1
horizontal_alignment = 1
[node name="time" type="Label" parent="sleep_mode/CenterContainer/VBoxContainer"]
unique_name_in_owner = true
margin_top = 94.0
margin_right = 93.0
margin_bottom = 116.0
offset_top = 94.0
offset_right = 93.0
offset_bottom = 116.0
text = "7 AM"
align = 1
horizontal_alignment = 1
[node name="hide_sleepmode" type="Button" parent="sleep_mode"]
margin_right = 350.0
margin_bottom = 650.0
offset_right = 350.0
offset_bottom = 650.0
mouse_default_cursor_shape = 2
flat = true
@@ -497,15 +401,15 @@ flat = true
one_shot = true
[node name="time talker" type="Node" parent="."]
script = ExtResource( 11 )
script = ExtResource("11")
[node name="speech" type="AudioStreamPlayer" parent="time talker"]
script = ExtResource( 10 )
script = ExtResource("10")
[node name="music" type="AudioStreamPlayer" parent="time talker"]
[node name="WeatherAPINode" type="Node" parent="."]
script = ExtResource( 9 )
script = ExtResource("9")
[node name="minute timer" type="Timer" parent="."]
@@ -516,10 +420,10 @@ autostart = true
[connection signal="tab_switched" from="TabContainer/VBoxContainer/screens" to="." method="_on_TabContainer_tab_selected"]
[connection signal="toggled" from="TabContainer/VBoxContainer/screens/current_time_screen/VBoxContainer/audio" to="." method="_on_audio_toggled"]
[connection signal="pressed" from="TabContainer/VBoxContainer/screens/globe_screen/globe_screen/credits_button" to="." method="_on_credits_button_pressed"]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/current_button" to="." method="_on_tab_button_pressed" binds= [ 0 ]]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/alarms_button" to="." method="_on_tab_button_pressed" binds= [ 1 ]]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/globe_button" to="." method="_on_tab_button_pressed" binds= [ 2 ]]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/settings_button" to="." method="_on_tab_button_pressed" binds= [ 3 ]]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/current_button" to="." method="_on_tab_button_pressed" binds= [0]]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/alarms_button" to="." method="_on_tab_button_pressed" binds= [1]]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/globe_button" to="." method="_on_tab_button_pressed" binds= [2]]
[connection signal="pressed" from="TabContainer/VBoxContainer/tab_buttons/settings_button" to="." method="_on_tab_button_pressed" binds= [3]]
[connection signal="pressed" from="alarm/VBoxContainer/HBoxContainer/snooze" to="alarm" method="_on_snooze_pressed"]
[connection signal="pressed" from="alarm/VBoxContainer/HBoxContainer/stop" to="alarm" method="_on_stop_pressed"]
[connection signal="timeout" from="alarm/snooze timer" to="alarm" method="_on_snooze_timer_timeout"]
+5 -5
View File
@@ -1,16 +1,16 @@
extends MarginContainer
export var auto_sleep :float = 60*2
export var prevent_sleep := false setget set_prevent_sleep
#export var auto_sleep :float = 6
@export var auto_sleep: float = 60 * 2
@export var prevent_sleep: bool = false:
set = set_prevent_sleep
onready var sleep_timer = $sleep_timer
@onready var sleep_timer = $sleep_timer
func _ready():
sleep_timer.start(auto_sleep)
func set_prevent_sleep(new:bool):
func set_prevent_sleep(new: bool):
if new or Config.flags.prevent_sleep_mode:
hide()
sleep_timer.stop()
+1
View File
@@ -0,0 +1 @@
uid://ptun8kaxl2lg
+17 -23
View File
@@ -2,8 +2,8 @@ extends Node
signal finished
onready var node_speech = $speech
onready var node_music = $music
@onready var node_speech = $speech
@onready var node_music = $music
const greet := [preload("res://assets/audio/clips/greet/voc_en_greet_goodmorning.mp3"), preload("res://assets/audio/clips/greet/voc_en_greet_hello.mp3")]
const its := preload("res://assets/audio/clips/misc/voc_en_its.mp3")
@@ -15,12 +15,12 @@ const weather := [preload("res://assets/audio/clips/weather/voc_en_weather_cloud
const music := [preload("res://assets/audio/clips/music/music_cloudy.wav"), preload("res://assets/audio/clips/music/music_foggy.wav"), preload("res://assets/audio/clips/music/music_partlycloudy.wav"), preload("res://assets/audio/clips/music/music_rainy.wav"), preload("res://assets/audio/clips/music/music_snowy.wav"), preload("res://assets/audio/clips/music/music_stormy.wav"), preload("res://assets/audio/clips/music/music_sunny.wav"), preload("res://assets/audio/clips/music/music_unknown.wav")]
var tween:SceneTreeTween
var tween: Tween
var A_finished = true
var B_finished = true
func play(moment:Moment, day:int, weather:int, music_weather_override=null, play_music := true, speak_time := true):
func play(moment: Moment, day: int, weather_idx: int, music_weather_override = null, play_music: bool = true, speak_time: bool = true):
stop()
if tween:
tween.kill()
@@ -34,16 +34,16 @@ func play(moment:Moment, day:int, weather:int, music_weather_override=null, play
1.0, # sleep for 1 second
greet[0] if moment.is_morning() else greet[1],
its,
load(hours[int(moment.hour-1) % 12]),
load(hours[int(moment.hour - 1) % 12]),
load(minutes[moment.minute]),
am_pm[0 if moment.is_am() else 1],
weekday[day],
]
var tune = music[Constants.WEATHER.UNKNOWN]
if weather < Constants.WEATHER.UNKNOWN:
out.append(self.weather[weather])
tune = music[weather]
if weather_idx < Constants.WEATHER.UNKNOWN:
out.append(self.weather[weather_idx])
tune = music[weather_idx]
if music_weather_override != null:
tune = music[music_weather_override]
@@ -52,15 +52,15 @@ func play(moment:Moment, day:int, weather:int, music_weather_override=null, play
if play_music:
node_music.stream = tune
node_music.play()
if A_finished and B_finished:
emit_signal("finished")
func stop(fadeout:=0.0):
if A_finished and B_finished:
finished.emit()
func stop(fadeout: float = 0.0):
if tween:
tween.kill()
if fadeout > 0:
print("fadeout ",fadeout)
print("fadeout ", fadeout)
tween = get_tree().create_tween()
tween.set_parallel(true)
tween.tween_property(node_music, "volume_db", -60.0, fadeout)
@@ -68,9 +68,7 @@ func stop(fadeout:=0.0):
tween.set_parallel(false)
tween.tween_interval(fadeout)
tween.play()
yield(tween, 'finished')
# tween.connect("finished", self, "stop")
# return
await tween.finished
node_music.stop()
node_speech.stop()
@@ -82,15 +80,11 @@ func is_playing():
func _on_speech_all_finished():
A_finished = true
# print("a_finished")
if A_finished and B_finished:
# print('boop')
emit_signal("finished")
finished.emit()
func _on_music_finished():
B_finished = true
# print("b_finished")
if A_finished and B_finished:
# print('boop')
emit_signal("finished")
finished.emit()
+1
View File
@@ -0,0 +1 @@
uid://eqpwcx4a3qyy
+17 -19
View File
@@ -1,23 +1,20 @@
extends VBoxContainer
onready var settings_api_key = $"%settings_api_key"
onready var settings_location = $"%settings_location"
onready var settings_celsius = $"%settings_celsius"
onready var settings_fahrenheit = $"%settings_fahrenheit"
onready var settings_autodark = $"%settings_autodark"
onready var settings_12_hour_clock = $"%settings_12_hour_clock"
@onready var settings_api_key = $"%settings_api_key"
@onready var settings_location = $"%settings_location"
@onready var settings_celsius = $"%settings_celsius"
@onready var settings_fahrenheit = $"%settings_fahrenheit"
@onready var settings_autodark = $"%settings_autodark"
@onready var settings_12_hour_clock = $"%settings_12_hour_clock"
var changed := false setget set_changed
func set_changed(new:bool):
changed = true
var changed: bool = false
func _ready():
settings_api_key.text = Config.flags.api_key
settings_location.text = Config.flags.location
settings_celsius.set_pressed_no_signal(Config.flags.show_celsius)
settings_fahrenheit.set_pressed_no_signal( Config.flags.show_fahrenheit )
settings_fahrenheit.set_pressed_no_signal(Config.flags.show_fahrenheit)
settings_autodark.set_pressed_no_signal(Config.flags.automatic_dark_mode)
settings_12_hour_clock.set_pressed_no_signal(Config.flags.use_12_hour_clock)
$"%prevent_sleep_mode".set_pressed_no_signal(Config.flags.prevent_sleep_mode)
@@ -32,28 +29,28 @@ func _on_settings_location_text_changed(new_text):
func _on_settings_celsius_toggled(button_pressed):
Config.flags.show_celsius = button_pressed
Config.flags.emit_signal("changed")
Config.flags.emit_changed()
func _on_settings_fahrenheit_toggled(button_pressed):
Config.flags.show_fahrenheit = button_pressed
Config.flags.emit_signal("changed")
Config.flags.emit_changed()
func _on_settings_autodark_toggled(button_pressed):
Config.flags.automatic_dark_mode = button_pressed
Config.flags.emit_signal("changed")
Config.flags.emit_changed()
func _on_settings_12_hour_clock_toggled(button_pressed):
Config.flags.use_12_hour_clock = button_pressed
Config.flags.emit_signal("changed")
Config.flags.emit_changed()
func _on_location_debounce_timeout():
Config.flags.location = $"%settings_location".text
Config.flags.api_key = $"%settings_api_key".text
Config.flags.emit_signal("changed")
Config.flags.emit_changed()
func _on_show_api_key_toggled(button_pressed):
@@ -62,10 +59,11 @@ func _on_show_api_key_toggled(button_pressed):
func _on_prevent_sleep_mode_toggled(button_pressed):
Config.flags.prevent_sleep_mode = button_pressed
Config.flags.emit_signal("changed")
Config.flags.emit_changed()
func _on_paste_key_pressed():
if not OS.clipboard in ['', null]:
$"%settings_api_key".text = OS.clipboard
var clipboard = DisplayServer.clipboard_get()
if not clipboard in ['', null]:
$"%settings_api_key".text = clipboard
_on_location_debounce_timeout()
@@ -0,0 +1 @@
uid://038gsxqs78l5
+167 -167
View File
@@ -1,129 +1,129 @@
[gd_scene load_steps=14 format=2]
[gd_scene load_steps=14 format=3]
[ext_resource path="res://assets/font/resource/menu_header.tres" type="DynamicFont" id=1]
[ext_resource path="res://assets/texture/settings/settingtemp_on1.png" type="Texture" id=2]
[ext_resource path="res://assets/texture/settings/settingtemp_on2.png" type="Texture" id=3]
[ext_resource path="res://assets/texture/settings/settingtemp1.png" type="Texture" id=4]
[ext_resource path="res://assets/texture/settings/settingtemp2.png" type="Texture" id=5]
[ext_resource path="res://scenes/settings_screen/settings_screen.gd" type="Script" id=6]
[ext_resource path="res://assets/texture/buttons/toggle_off.png" type="Texture" id=7]
[ext_resource path="res://assets/texture/buttons/toggle_on.png" type="Texture" id=8]
[ext_resource path="res://assets/main.tres" type="Theme" id=9]
[ext_resource path="res://assets/texture/settings/eye_closed.png" type="Texture" id=10]
[ext_resource path="res://assets/texture/settings/eye_open.png" type="Texture" id=11]
[ext_resource type="FontVariation" path="res://assets/font/resource/menu_header.tres" id="1"]
[ext_resource type="Texture2D" path="res://assets/texture/settings/settingtemp_on1.png" id="2"]
[ext_resource type="Texture2D" path="res://assets/texture/settings/settingtemp_on2.png" id="3"]
[ext_resource type="Texture2D" path="res://assets/texture/settings/settingtemp1.png" id="4"]
[ext_resource type="Texture2D" path="res://assets/texture/settings/settingtemp2.png" id="5"]
[ext_resource type="Script" path="res://scenes/settings_screen/settings_screen.gd" id="6"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/toggle_off.png" id="7"]
[ext_resource type="Texture2D" path="res://assets/texture/buttons/toggle_on.png" id="8"]
[ext_resource type="Theme" path="res://assets/main.tres" id="9"]
[ext_resource type="Texture2D" path="res://assets/texture/settings/eye_closed.png" id="10"]
[ext_resource type="Texture2D" path="res://assets/texture/settings/eye_open.png" id="11"]
[sub_resource type="Gradient" id=1]
offsets = PoolRealArray( 0, 0.256983 )
colors = PoolColorArray( 0, 0, 0, 0.262745, 0, 0, 0, 0 )
[sub_resource type="Gradient" id="1"]
offsets = PackedFloat32Array(0, 0.256983)
colors = PackedColorArray(0, 0, 0, 0.262745, 0, 0, 0, 0)
[sub_resource type="GradientTexture2D" id=12]
gradient = SubResource( 1 )
[sub_resource type="GradientTexture2D" id="12"]
gradient = SubResource("1")
height = 32
fill_to = Vector2( 0, 1 )
fill_to = Vector2(0, 1)
[node name="settings_screen" type="VBoxContainer"]
margin_right = 350.0
margin_bottom = 647.0
rect_pivot_offset = Vector2( -354, 186 )
offset_right = 350.0
offset_bottom = 647.0
pivot_offset = Vector2(-354, 186)
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
theme = ExtResource( 9 )
custom_constants/separation = 0
script = ExtResource( 6 )
theme = ExtResource("9")
theme_override_constants/separation = 0
script = ExtResource("6")
[node name="HBoxContainer" type="HBoxContainer" parent="."]
margin_right = 350.0
margin_bottom = 45.0
rect_min_size = Vector2( 0, 45 )
offset_right = 350.0
offset_bottom = 45.0
custom_minimum_size = Vector2(0, 45)
mouse_filter = 2
alignment = 1
[node name="Label" type="Label" parent="HBoxContainer"]
margin_left = 123.0
margin_top = 10.0
margin_right = 226.0
margin_bottom = 35.0
custom_fonts/font = ExtResource( 1 )
text = "Settings"
uppercase = true
offset_left = 123.0
offset_top = 10.0
offset_right = 226.0
offset_bottom = 35.0
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 26
text = "SETTINGS"
[node name="VBoxContainer" type="MarginContainer" parent="."]
margin_top = 45.0
margin_right = 350.0
margin_bottom = 647.0
offset_top = 45.0
offset_right = 350.0
offset_bottom = 647.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="TextureRect2" type="TextureRect" parent="VBoxContainer"]
margin_right = 350.0
margin_bottom = 21.0
rect_min_size = Vector2( 0, 21 )
offset_right = 350.0
offset_bottom = 21.0
custom_minimum_size = Vector2(0, 21)
mouse_filter = 2
size_flags_vertical = 0
texture = SubResource( 12 )
expand = true
stretch_mode = 2
texture = SubResource("12")
expand_mode = 1
stretch_mode = 1
[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer"]
margin_right = 350.0
margin_bottom = 602.0
offset_right = 350.0
offset_bottom = 602.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
scroll_horizontal_enabled = false
horizontal_scroll_mode = 0
[node name="MarginContainer" type="MarginContainer" parent="VBoxContainer/ScrollContainer"]
margin_right = 350.0
margin_bottom = 602.0
offset_right = 350.0
offset_bottom = 602.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
custom_constants/margin_right = 10
custom_constants/margin_left = 10
theme_override_constants/margin_right = 10
theme_override_constants/margin_left = 10
[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer"]
margin_left = 10.0
margin_right = 340.0
margin_bottom = 602.0
offset_left = 10.0
offset_right = 340.0
offset_bottom = 602.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Control" type="Control" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"]
margin_right = 330.0
margin_bottom = 20.0
rect_min_size = Vector2( 0, 20 )
offset_right = 330.0
offset_bottom = 20.0
custom_minimum_size = Vector2(0, 20)
mouse_filter = 2
[node name="alarm_items" type="VBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer"]
margin_top = 24.0
margin_right = 330.0
margin_bottom = 602.0
offset_top = 24.0
offset_right = 330.0
offset_bottom = 602.0
mouse_filter = 2
size_flags_horizontal = 3
size_flags_vertical = 3
[node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_right = 330.0
margin_bottom = 48.0
rect_min_size = Vector2( 0, 48 )
offset_right = 330.0
offset_bottom = 48.0
custom_minimum_size = Vector2(0, 48)
text = "weatherapi.com API key"
align = 1
valign = 2
horizontal_alignment = 1
vertical_alignment = 2
[node name="HBoxContainer3" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 52.0
margin_right = 330.0
margin_bottom = 84.0
offset_top = 52.0
offset_right = 330.0
offset_bottom = 84.0
mouse_filter = 2
[node name="settings_api_key" type="LineEdit" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer3"]
unique_name_in_owner = true
margin_right = 294.0
margin_bottom = 32.0
hint_tooltip = "API key from weatherAPI.com.
offset_right = 294.0
offset_bottom = 32.0
tooltip_text = "API key from weatherAPI.com.
This is required to make
use of the weather features.
@@ -135,182 +135,182 @@ secret = true
secret_character = "·"
[node name="show_api_key" type="TextureButton" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer3"]
margin_left = 298.0
margin_right = 330.0
margin_bottom = 32.0
rect_min_size = Vector2( 32, 0 )
hint_tooltip = "Reveal API key"
offset_left = 298.0
offset_right = 330.0
offset_bottom = 32.0
custom_minimum_size = Vector2(32, 0)
tooltip_text = "Reveal API key"
mouse_default_cursor_shape = 2
toggle_mode = true
texture_normal = ExtResource( 10 )
texture_pressed = ExtResource( 11 )
expand = true
texture_normal = ExtResource("10")
texture_pressed = ExtResource("11")
ignore_texture_size = true
stretch_mode = 5
[node name="paste_key" type="Button" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 88.0
margin_right = 330.0
margin_bottom = 118.0
offset_top = 88.0
offset_right = 330.0
offset_bottom = 118.0
mouse_default_cursor_shape = 2
text = "Paste API key"
[node name="Label2" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 122.0
margin_right = 330.0
margin_bottom = 170.0
rect_min_size = Vector2( 0, 48 )
offset_top = 122.0
offset_right = 330.0
offset_bottom = 170.0
custom_minimum_size = Vector2(0, 48)
text = "Location"
align = 1
valign = 2
horizontal_alignment = 1
vertical_alignment = 2
[node name="settings_location" type="LineEdit" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
unique_name_in_owner = true
margin_top = 174.0
margin_right = 330.0
margin_bottom = 206.0
hint_tooltip = "Location to use for weather data"
offset_top = 174.0
offset_right = 330.0
offset_bottom = 206.0
tooltip_text = "Location to use for weather data"
text = "Amsterdam"
[node name="Label3" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 210.0
margin_right = 330.0
margin_bottom = 258.0
rect_min_size = Vector2( 0, 48 )
offset_top = 210.0
offset_right = 330.0
offset_bottom = 258.0
custom_minimum_size = Vector2(0, 48)
text = "Displayed temperatures"
align = 1
valign = 2
horizontal_alignment = 1
vertical_alignment = 2
[node name="temperatures" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 262.0
margin_right = 330.0
margin_bottom = 322.0
offset_top = 262.0
offset_right = 330.0
offset_bottom = 322.0
mouse_filter = 2
[node name="settings_celsius" type="TextureButton" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/temperatures"]
unique_name_in_owner = true
margin_right = 163.0
margin_bottom = 60.0
rect_min_size = Vector2( 0, 60 )
hint_tooltip = "Show temperature in celsius"
offset_right = 163.0
offset_bottom = 60.0
custom_minimum_size = Vector2(0, 60)
tooltip_text = "Show temperature in celsius"
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
toggle_mode = true
texture_normal = ExtResource( 5 )
texture_pressed = ExtResource( 3 )
expand = true
texture_normal = ExtResource("5")
texture_pressed = ExtResource("3")
ignore_texture_size = true
stretch_mode = 5
[node name="settings_fahrenheit" type="TextureButton" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/temperatures"]
unique_name_in_owner = true
margin_left = 167.0
margin_right = 330.0
margin_bottom = 60.0
rect_min_size = Vector2( 0, 60 )
hint_tooltip = "Show temperature in fahrenheit"
offset_left = 167.0
offset_right = 330.0
offset_bottom = 60.0
custom_minimum_size = Vector2(0, 60)
tooltip_text = "Show temperature in fahrenheit"
mouse_default_cursor_shape = 2
size_flags_horizontal = 3
toggle_mode = true
texture_normal = ExtResource( 4 )
texture_pressed = ExtResource( 2 )
expand = true
texture_normal = ExtResource("4")
texture_pressed = ExtResource("2")
ignore_texture_size = true
stretch_mode = 5
[node name="Label4" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 326.0
margin_right = 330.0
margin_bottom = 348.0
rect_min_size = Vector2( 0, 16 )
align = 1
valign = 2
offset_top = 326.0
offset_right = 330.0
offset_bottom = 348.0
custom_minimum_size = Vector2(0, 16)
horizontal_alignment = 1
vertical_alignment = 2
[node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 352.0
margin_right = 330.0
margin_bottom = 409.0
offset_top = 352.0
offset_right = 330.0
offset_bottom = 409.0
mouse_filter = 2
[node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer"]
margin_top = 17.0
margin_right = 192.0
margin_bottom = 39.0
offset_top = 17.0
offset_right = 192.0
offset_bottom = 39.0
text = "Automatic dark mode"
[node name="settings_autodark" type="TextureButton" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer"]
unique_name_in_owner = true
margin_left = 198.0
margin_right = 330.0
margin_bottom = 57.0
rect_min_size = Vector2( 132, 57 )
hint_tooltip = "Darken interface and
offset_left = 198.0
offset_right = 330.0
offset_bottom = 57.0
custom_minimum_size = Vector2(132, 57)
tooltip_text = "Darken interface and
backgrounds in the evening"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 7 )
texture_pressed = ExtResource( 8 )
expand = true
button_pressed = true
texture_normal = ExtResource("7")
texture_pressed = ExtResource("8")
ignore_texture_size = true
stretch_mode = 4
[node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 413.0
margin_right = 330.0
margin_bottom = 470.0
offset_top = 413.0
offset_right = 330.0
offset_bottom = 470.0
mouse_filter = 2
[node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer2"]
margin_top = 17.0
margin_right = 125.0
margin_bottom = 39.0
offset_top = 17.0
offset_right = 125.0
offset_bottom = 39.0
text = "12 hour clock"
[node name="settings_12_hour_clock" type="TextureButton" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer2"]
unique_name_in_owner = true
margin_left = 198.0
margin_right = 330.0
margin_bottom = 57.0
rect_min_size = Vector2( 132, 57 )
hint_tooltip = "Use a 12 hour AM/PM clock
offset_left = 198.0
offset_right = 330.0
offset_bottom = 57.0
custom_minimum_size = Vector2(132, 57)
tooltip_text = "Use a 12 hour AM/PM clock
instead of 24 hours"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 7 )
texture_pressed = ExtResource( 8 )
expand = true
button_pressed = true
texture_normal = ExtResource("7")
texture_pressed = ExtResource("8")
ignore_texture_size = true
stretch_mode = 4
[node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"]
margin_top = 474.0
margin_right = 330.0
margin_bottom = 531.0
offset_top = 474.0
offset_right = 330.0
offset_bottom = 531.0
mouse_filter = 2
[node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer4"]
margin_top = 17.0
margin_right = 173.0
margin_bottom = 39.0
offset_top = 17.0
offset_right = 173.0
offset_bottom = 39.0
text = "Prevent sleep mode"
[node name="prevent_sleep_mode" type="TextureButton" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer4"]
unique_name_in_owner = true
margin_left = 198.0
margin_right = 330.0
margin_bottom = 57.0
rect_min_size = Vector2( 132, 57 )
hint_tooltip = "Use a 12 hour AM/PM clock
instead of 24 hours"
offset_left = 198.0
offset_right = 330.0
offset_bottom = 57.0
custom_minimum_size = Vector2(132, 57)
tooltip_text = "Prevent the screen from
entering sleep mode"
mouse_default_cursor_shape = 2
size_flags_horizontal = 10
size_flags_vertical = 3
toggle_mode = true
pressed = true
texture_normal = ExtResource( 7 )
texture_pressed = ExtResource( 8 )
expand = true
button_pressed = true
texture_normal = ExtResource("7")
texture_pressed = ExtResource("8")
ignore_texture_size = true
stretch_mode = 4
[node name="api_debounce" type="Timer" parent="."]
@@ -1,55 +1,71 @@
@tool
extends HBoxContainer
tool
export var show_celsius := true setget set_show_celsius
export var show_fahrenheit := true setget set_show_fahrenheit
export var degrees_celsius := 0.0 setget set_degrees_celsius
export var degrees_fahrenheit := 0.0 setget set_degrees_fahrenheit
export var temperature_unknown := true setget set_temperature_unknown
@export var show_celsius: bool = true:
set = set_show_celsius
@export var show_fahrenheit: bool = true:
set = set_show_fahrenheit
@export var degrees_celsius: float = 0.0:
set = set_degrees_celsius,
get = get_degrees_celsius
@export var degrees_fahrenheit: float = 0.0:
set = set_degrees_fahrenheit,
get = get_degrees_fahrenheit
@export var temperature_unknown: bool = true:
set = set_temperature_unknown
var _c: float = 0.0
var _f: float = 0.0
func _ready():
_check_slash()
_update_text()
func set_temperature_unknown(new:bool):
func set_temperature_unknown(new: bool):
temperature_unknown = new
_update_text()
func set_show_celsius(new:bool):
func set_show_celsius(new: bool):
show_celsius = new
$celsius.visible = new
$degrees.visible = new
if has_node("celsius"):
$celsius.visible = new
$degrees.visible = new
_check_slash()
func set_show_fahrenheit(new:bool):
func set_show_fahrenheit(new: bool):
show_fahrenheit = new
$fahrenheit.visible = new
$degrees2.visible = new
if has_node("fahrenheit"):
$fahrenheit.visible = new
$degrees2.visible = new
_check_slash()
func set_degrees_celsius(new:float):
degrees_celsius = new
degrees_fahrenheit = Constants.celsius_to_fahrenheit(degrees_celsius)
func set_degrees_celsius(new: float):
_c = new
_f = Constants.celsius_to_fahrenheit(new)
_update_text()
func set_degrees_fahrenheit(new:float):
degrees_fahrenheit = new
degrees_celsius = Constants.fahrenheit_to_celsius(degrees_fahrenheit)
func get_degrees_celsius() -> float:
return _c
func set_degrees_fahrenheit(new: float):
_f = new
_c = Constants.fahrenheit_to_celsius(new)
_update_text()
func get_degrees_fahrenheit() -> float:
return _f
func _update_text():
if !$celsius:
if !has_node("celsius"):
return
if temperature_unknown:
$celsius.text = '?'
$fahrenheit.text = '?'
else:
$celsius.text = str(stepify(degrees_celsius, 1))
$fahrenheit.text = str(stepify(degrees_fahrenheit, 1))
$celsius.text = str(snapped(_c, 1))
$fahrenheit.text = str(snapped(_f, 1))
func _check_slash():
if !$slash:
if !has_node("slash"):
return
$slash.visible = show_celsius and show_fahrenheit
@@ -0,0 +1 @@
uid://b8tpwmho88e23
@@ -1,55 +1,57 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=4 format=3]
[ext_resource path="res://scenes/temperature_display/temperature_display.gd" type="Script" id=1]
[ext_resource path="res://assets/font/resource/temperature_bold.tres" type="DynamicFont" id=2]
[ext_resource path="res://assets/font/resource/temperature_normal.tres" type="DynamicFont" id=3]
[ext_resource type="Script" path="res://scenes/temperature_display/temperature_display.gd" id="1"]
[ext_resource type="FontVariation" path="res://assets/font/resource/temperature_bold.tres" id="2"]
[ext_resource type="FontVariation" path="res://assets/font/resource/temperature_normal.tres" id="3"]
[node name="temperature_display" type="HBoxContainer"]
margin_right = 40.0
margin_bottom = 40.0
custom_constants/separation = -2
offset_right = 40.0
offset_bottom = 40.0
theme_override_constants/separation = -2
alignment = 1
script = ExtResource( 1 )
__meta__ = {
"_edit_horizontal_guides_": [ 143.0 ]
}
script = ExtResource("1")
degrees_fahrenheit = 32.0
[node name="celsius" type="Label" parent="."]
margin_top = 2.0
margin_right = 18.0
margin_bottom = 38.0
custom_fonts/font = ExtResource( 2 )
offset_top = 2.0
offset_right = 18.0
offset_bottom = 38.0
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 38
text = "?"
[node name="degrees" type="Label" parent="."]
margin_left = 16.0
margin_top = 2.0
margin_right = 45.0
margin_bottom = 38.0
custom_fonts/font = ExtResource( 3 )
offset_left = 16.0
offset_top = 2.0
offset_right = 45.0
offset_bottom = 38.0
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 38
text = "°C"
[node name="slash" type="Label" parent="."]
margin_left = 43.0
margin_top = 2.0
margin_right = 75.0
margin_bottom = 38.0
custom_fonts/font = ExtResource( 3 )
offset_left = 43.0
offset_top = 2.0
offset_right = 75.0
offset_bottom = 38.0
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 38
text = " / "
[node name="fahrenheit" type="Label" parent="."]
margin_left = 73.0
margin_top = 2.0
margin_right = 91.0
margin_bottom = 38.0
custom_fonts/font = ExtResource( 2 )
offset_left = 73.0
offset_top = 2.0
offset_right = 91.0
offset_bottom = 38.0
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 38
text = "?"
[node name="degrees2" type="Label" parent="."]
margin_left = 89.0
margin_top = 2.0
margin_right = 118.0
margin_bottom = 38.0
custom_fonts/font = ExtResource( 3 )
offset_left = 89.0
offset_top = 2.0
offset_right = 118.0
offset_bottom = 38.0
theme_override_fonts/font = ExtResource("3")
theme_override_font_sizes/font_size = 38
text = "°F"
+11 -7
View File
@@ -1,22 +1,26 @@
extends HBoxContainer
export var use_12_hours := true setget set_use_12_hours
export(Resource) var moment = Moment.new() setget set_moment
@export var use_12_hours: bool = true:
set = set_use_12_hours
@export var moment: Resource = Moment.new():
set = set_moment
onready var hour = $hour
onready var minute = $minute
onready var am_pm := $VBoxContainer/am_pm
@onready var hour = $hour
@onready var minute = $minute
@onready var am_pm = $VBoxContainer/am_pm
func set_moment(new_moment:Moment):
func set_moment(new_moment):
moment = new_moment
_update()
func set_use_12_hours(new_value:bool):
func set_use_12_hours(new_value: bool):
use_12_hours = new_value
_update()
func _update():
if not is_inside_tree():
return
minute.text = moment.padded_minute()
am_pm.visible = use_12_hours
am_pm.text = moment.am_pm()
+1
View File
@@ -0,0 +1 @@
uid://dgabsu410qkro
+34 -32
View File
@@ -1,51 +1,53 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=4 format=3]
[ext_resource path="res://assets/font/resource/time_small.tres" type="DynamicFont" id=1]
[ext_resource path="res://assets/font/resource/time_big.tres" type="DynamicFont" id=2]
[ext_resource path="res://scenes/time_display/time_display.gd" type="Script" id=3]
[ext_resource type="FontVariation" path="res://assets/font/resource/time_small.tres" id="1"]
[ext_resource type="FontVariation" path="res://assets/font/resource/time_big.tres" id="2"]
[ext_resource type="Script" path="res://scenes/time_display/time_display.gd" id="3"]
[node name="time_display" type="HBoxContainer"]
margin_right = 116.0
margin_bottom = 45.0
script = ExtResource( 3 )
offset_right = 116.0
offset_bottom = 45.0
script = ExtResource("3")
[node name="hour" type="Label" parent="."]
margin_right = 92.0
margin_bottom = 89.0
custom_fonts/font = ExtResource( 2 )
offset_right = 92.0
offset_bottom = 89.0
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 96
text = "10"
[node name="Control" type="Control" parent="."]
margin_left = 96.0
margin_right = 116.0
margin_bottom = 89.0
rect_min_size = Vector2( 20, 0 )
offset_left = 96.0
offset_right = 116.0
offset_bottom = 89.0
custom_minimum_size = Vector2(20, 0)
size_flags_horizontal = 3
[node name="minute" type="Label" parent="."]
margin_left = 120.0
margin_right = 212.0
margin_bottom = 89.0
custom_fonts/font = ExtResource( 2 )
offset_left = 120.0
offset_right = 212.0
offset_bottom = 89.0
theme_override_fonts/font = ExtResource("2")
theme_override_font_sizes/font_size = 96
text = "12"
[node name="VBoxContainer" type="VBoxContainer" parent="."]
margin_left = 216.0
margin_right = 246.0
margin_bottom = 89.0
custom_constants/separation = 0
offset_left = 216.0
offset_right = 246.0
offset_bottom = 89.0
theme_override_constants/separation = 0
[node name="am_pm" type="Label" parent="VBoxContainer"]
margin_right = 30.0
margin_bottom = 78.0
offset_right = 30.0
offset_bottom = 78.0
size_flags_vertical = 3
custom_fonts/font = ExtResource( 1 )
text = "am"
valign = 2
uppercase = true
theme_override_fonts/font = ExtResource("1")
theme_override_font_sizes/font_size = 24
text = "AM"
vertical_alignment = 2
[node name="Control" type="Control" parent="VBoxContainer"]
margin_top = 78.0
margin_right = 30.0
margin_bottom = 89.0
rect_min_size = Vector2( 0, 11 )
offset_top = 78.0
offset_right = 30.0
offset_bottom = 89.0
custom_minimum_size = Vector2(0, 11)
+6 -3
View File
@@ -1,6 +1,9 @@
@tool
extends TextureRect
tool
export(Constants.WEATHER) var weather = Constants.WEATHER.UNKNOWN setget set_weather
@export var weather: Constants.WEATHER = Constants.WEATHER.UNKNOWN:
set = set_weather
const images := {
Constants.WEATHER.CLOUDY: preload("res://assets/texture/weather_icons/weather3.png"),
Constants.WEATHER.FOGGY: preload("res://assets/texture/weather_icons/weather7.png"),
@@ -15,7 +18,7 @@ const images := {
func _ready():
set_weather(weather)
func set_weather(new:int):
func set_weather(new: int):
if !images.has(new):
new = Constants.WEATHER.UNKNOWN
weather = new
@@ -0,0 +1 @@
uid://baru883baoj8p
+9 -9
View File
@@ -1,13 +1,13 @@
[gd_scene load_steps=3 format=2]
[gd_scene load_steps=3 format=3]
[ext_resource path="res://scenes/weather_display/weather_display.gd" type="Script" id=1]
[ext_resource path="res://assets/texture/weather_icons/weather5.png" type="Texture" id=2]
[ext_resource type="Script" path="res://scenes/weather_display/weather_display.gd" id="1"]
[ext_resource type="Texture2D" path="res://assets/texture/weather_icons/weather5.png" id="2"]
[node name="weather_display" type="TextureRect"]
margin_left = -26.0
margin_top = 171.0
margin_right = 454.0
margin_bottom = 502.0
texture = ExtResource( 2 )
script = ExtResource( 1 )
offset_left = -26.0
offset_top = 171.0
offset_right = 454.0
offset_bottom = 502.0
texture = ExtResource("2")
script = ExtResource("1")
weather = 5