diff --git a/README.md b/README.md index 8d1c8b6..c6a5320 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ - +![UNIQLONE]("banner.png") diff --git a/assets/main.tres b/assets/main.tres index 6f67736..238a108 100644 --- a/assets/main.tres +++ b/assets/main.tres @@ -1,9 +1,20 @@ -[gd_resource type="Theme" load_steps=15 format=2] +[gd_resource type="Theme" load_steps=16 format=2] [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/font/resource/default.tres" type="DynamicFont" id=3] +[sub_resource type="StyleBoxFlat" id=12] +bg_color = Color( 0, 0, 0, 0.184314 ) +border_width_left = 4 +border_width_top = 4 +border_width_right = 4 +border_width_bottom = 4 +corner_radius_top_left = 10 +corner_radius_top_right = 10 +corner_radius_bottom_right = 10 +corner_radius_bottom_left = 10 + [sub_resource type="StyleBoxEmpty" id=1] [sub_resource type="StyleBoxFlat" id=7] @@ -93,6 +104,7 @@ corner_radius_bottom_left = 10 [resource] default_font = ExtResource( 3 ) +Button/styles/normal = SubResource( 12 ) CheckButton/icons/off = ExtResource( 2 ) CheckButton/icons/on = ExtResource( 1 ) HScrollBar/styles/grabber = SubResource( 1 ) @@ -107,6 +119,12 @@ SelectedItem/styles/hover = SubResource( 6 ) SelectedItem/styles/normal = SubResource( 4 ) SelectedItem/styles/pressed = SubResource( 5 ) TabContainer/styles/panel = SubResource( 2 ) +VScrollBar/icons/decrement = null +VScrollBar/icons/decrement_highlight = null +VScrollBar/icons/decrement_pressed = null +VScrollBar/icons/increment = null +VScrollBar/icons/increment_highlight = null +VScrollBar/icons/increment_pressed = null VScrollBar/styles/grabber = SubResource( 8 ) VScrollBar/styles/grabber_highlight = SubResource( 9 ) VScrollBar/styles/grabber_pressed = SubResource( 10 ) diff --git a/scenes/current_time_screen/current_time_screen.gd b/scenes/current_time_screen/current_time_screen.gd index 7f9210a..e19c814 100644 --- a/scenes/current_time_screen/current_time_screen.gd +++ b/scenes/current_time_screen/current_time_screen.gd @@ -23,7 +23,7 @@ func _on_config_changed(): func hourly_weather_update(json): var WC = Constants.WEATHER.UNKNOWN var temp = 0.0 - if json != null: + if json != null and !json.has('error'): WC = json['current']['condition']['code'] temp = json['current']['temp_c'] diff --git a/scenes/main/main.gd b/scenes/main/main.gd index 5601879..3d2febd 100644 --- a/scenes/main/main.gd +++ b/scenes/main/main.gd @@ -75,7 +75,7 @@ func _on_hourly_weather_timer_timeout(): func _on_WeatherAPINode_received_forecast(json): var WC = Constants.WEATHER.UNKNOWN print('weather update: ',json) - if json != null: + if json != null 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) diff --git a/scenes/settings_screen/settings_screen.gd b/scenes/settings_screen/settings_screen.gd index fc09d3a..d22c403 100644 --- a/scenes/settings_screen/settings_screen.gd +++ b/scenes/settings_screen/settings_screen.gd @@ -63,3 +63,9 @@ 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") + + +func _on_paste_key_pressed(): + if not OS.clipboard in ['', null]: + $"%settings_api_key".text = OS.clipboard + _on_location_debounce_timeout() diff --git a/scenes/settings_screen/settings_screen.tscn b/scenes/settings_screen/settings_screen.tscn index c6acf96..f84b1e9 100644 --- a/scenes/settings_screen/settings_screen.tscn +++ b/scenes/settings_screen/settings_screen.tscn @@ -147,10 +147,17 @@ texture_pressed = ExtResource( 11 ) expand = true stretch_mode = 5 -[node name="Label2" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] +[node name="paste_key" type="Button" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] margin_top = 88.0 margin_right = 330.0 -margin_bottom = 136.0 +margin_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 ) text = "Location" align = 1 @@ -158,25 +165,25 @@ valign = 2 [node name="settings_location" type="LineEdit" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] unique_name_in_owner = true -margin_top = 140.0 +margin_top = 174.0 margin_right = 330.0 -margin_bottom = 172.0 +margin_bottom = 206.0 hint_tooltip = "Location to use for weather data" text = "Amsterdam" [node name="Label3" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] -margin_top = 176.0 +margin_top = 210.0 margin_right = 330.0 -margin_bottom = 224.0 +margin_bottom = 258.0 rect_min_size = Vector2( 0, 48 ) text = "Displayed temperatures" align = 1 valign = 2 [node name="temperatures" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] -margin_top = 228.0 +margin_top = 262.0 margin_right = 330.0 -margin_bottom = 288.0 +margin_bottom = 322.0 mouse_filter = 2 [node name="settings_celsius" type="TextureButton" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/temperatures"] @@ -209,17 +216,17 @@ expand = true stretch_mode = 5 [node name="Label4" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] -margin_top = 292.0 +margin_top = 326.0 margin_right = 330.0 -margin_bottom = 314.0 +margin_bottom = 348.0 rect_min_size = Vector2( 0, 16 ) align = 1 valign = 2 [node name="HBoxContainer" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] -margin_top = 318.0 +margin_top = 352.0 margin_right = 330.0 -margin_bottom = 375.0 +margin_bottom = 409.0 mouse_filter = 2 [node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer"] @@ -247,9 +254,9 @@ expand = true stretch_mode = 4 [node name="HBoxContainer2" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] -margin_top = 379.0 +margin_top = 413.0 margin_right = 330.0 -margin_bottom = 436.0 +margin_bottom = 470.0 mouse_filter = 2 [node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer2"] @@ -277,9 +284,9 @@ expand = true stretch_mode = 4 [node name="HBoxContainer4" type="HBoxContainer" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items"] -margin_top = 440.0 +margin_top = 474.0 margin_right = 330.0 -margin_bottom = 497.0 +margin_bottom = 531.0 mouse_filter = 2 [node name="Label" type="Label" parent="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer4"] @@ -312,6 +319,7 @@ one_shot = true [connection signal="text_changed" from="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer3/settings_api_key" to="." method="_on_settings_api_key_text_changed"] [connection signal="toggled" from="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/HBoxContainer3/show_api_key" to="." method="_on_show_api_key_toggled"] +[connection signal="pressed" from="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/paste_key" to="." method="_on_paste_key_pressed"] [connection signal="text_changed" from="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/settings_location" to="." method="_on_settings_location_text_changed"] [connection signal="toggled" from="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/temperatures/settings_celsius" to="." method="_on_settings_celsius_toggled"] [connection signal="toggled" from="VBoxContainer/ScrollContainer/MarginContainer/VBoxContainer/alarm_items/temperatures/settings_fahrenheit" to="." method="_on_settings_fahrenheit_toggled"]