initial commit, hope i didnt push any keys :P
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
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
|
||||
|
||||
|
||||
func _ready():
|
||||
Config.connect("changed", self, '_on_config_changed')
|
||||
_on_config_changed()
|
||||
|
||||
func _on_config_changed():
|
||||
$"%location_display".text = Config.flags.location
|
||||
$"%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
|
||||
|
||||
|
||||
func hourly_weather_update(json):
|
||||
var WC = Constants.WEATHER.UNKNOWN
|
||||
var temp = 0.0
|
||||
if json != null:
|
||||
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
|
||||
weather_display.set_weather(weather)
|
||||
|
||||
func minute_timer_update(time):
|
||||
time_display.set_moment(Moment.new(time['hour'], time['minute']))
|
||||
time_display.use_12_hours = Config.flags.use_12_hour_clock
|
||||
@@ -0,0 +1,126 @@
|
||||
[gd_scene load_steps=9 format=2]
|
||||
|
||||
[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]
|
||||
|
||||
[node name="current_time_screen" type="HBoxContainer" groups=["hourly_weather_updates", "minute_timer_updates"]]
|
||||
margin_right = 350.0
|
||||
margin_bottom = 600.0
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
alignment = 1
|
||||
script = ExtResource( 5 )
|
||||
|
||||
[node name="Control3" type="Control" parent="."]
|
||||
margin_right = 21.0
|
||||
margin_bottom = 600.0
|
||||
rect_min_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
|
||||
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 )
|
||||
mouse_filter = 2
|
||||
size_flags_vertical = 3
|
||||
|
||||
[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
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 4
|
||||
|
||||
[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 )
|
||||
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
|
||||
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
|
||||
|
||||
[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
|
||||
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 )
|
||||
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
|
||||
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
|
||||
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 )
|
||||
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 )
|
||||
mouse_filter = 2
|
||||
size_flags_horizontal = 3
|
||||
size_flags_vertical = 3
|
||||
Reference in New Issue
Block a user