From e379e8071191f27df48508eac81aefbf5fa600c7 Mon Sep 17 00:00:00 2001 From: Nordup Date: Mon, 3 Jul 2023 01:03:56 +0400 Subject: [PATCH] search status: download anim; icon.svg --- project/app_icon/icon.svg | 469 ++---------------- project/app_icon/icon.svg.import | 4 +- project/scenes/components/search.tscn | 24 +- .../scripts/ui/search/download_animation.gd | 24 + project/scripts/ui/search/search_status.gd | 1 + project/textures/gate.svg | 60 +++ project/textures/gate.svg.import | 37 ++ project/textures/search.svg | 62 ++- 8 files changed, 243 insertions(+), 438 deletions(-) create mode 100644 project/scripts/ui/search/download_animation.gd create mode 100755 project/textures/gate.svg create mode 100644 project/textures/gate.svg.import diff --git a/project/app_icon/icon.svg b/project/app_icon/icon.svg index 56e4c33..36451bb 100755 --- a/project/app_icon/icon.svg +++ b/project/app_icon/icon.svg @@ -2,15 +2,15 @@ + inkscape:deskcolor="#505050" + showborder="false" /> + gradientTransform="matrix(0.26458333,0,0,0.26458333,-2.2638344,6.5e-6)" /> + gradientTransform="matrix(0.26458332,0,0,0.26458332,-2.2638341,0)" /> + transform="translate(2.2638371)"> diff --git a/project/app_icon/icon.svg.import b/project/app_icon/icon.svg.import index 719e101..a735111 100644 --- a/project/app_icon/icon.svg.import +++ b/project/app_icon/icon.svg.import @@ -21,7 +21,7 @@ compress/lossy_quality=0.7 compress/hdr_compression=1 compress/normal_map=0 compress/channel_pack=0 -mipmaps/generate=false +mipmaps/generate=true mipmaps/limit=-1 roughness/mode=0 roughness/src_normal="" @@ -32,6 +32,6 @@ process/hdr_as_srgb=false process/hdr_clamp_exposure=false process/size_limit=0 detect_3d/compress_to=0 -svg/scale=0.066 +svg/scale=1.0 editor/scale_with_editor_scale=false editor/convert_colors_with_editor_theme=false diff --git a/project/scenes/components/search.tscn b/project/scenes/components/search.tscn index 9dd5854..dabe582 100644 --- a/project/scenes/components/search.tscn +++ b/project/scenes/components/search.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=14 format=3 uid="uid://ctam0fxigbefk"] +[gd_scene load_steps=15 format=3 uid="uid://ctam0fxigbefk"] [ext_resource type="Script" path="res://scripts/ui/search.gd" id="1_7ivk2"] [ext_resource type="Resource" uid="uid://b1xvdym0qh6td" path="res://resources/gate_events.res" id="2_13io8"] @@ -6,8 +6,9 @@ [ext_resource type="Script" path="res://scripts/ui/search/search_status.gd" id="3_3p1re"] [ext_resource type="Script" path="res://scripts/ui/search_go.gd" id="3_eayvw"] [ext_resource type="Texture2D" uid="uid://byvigfpu44dnu" path="res://textures/arrow.svg" id="5_dqxpp"] -[ext_resource type="Texture2D" uid="uid://8wvea7j0v0rx" path="res://textures/Reload.svg" id="5_yhqf5"] +[ext_resource type="Script" path="res://scripts/ui/search/download_animation.gd" id="6_fn1n3"] [ext_resource type="Script" path="res://scripts/ui/menu/star.gd" id="6_iyikx"] +[ext_resource type="Texture2D" uid="uid://cx3xxaqo3s3eq" path="res://textures/gate.svg" id="6_twd8p"] [ext_resource type="Resource" uid="uid://bewhdj6jugt6q" path="res://resources/bookmarks.tres" id="7_2mijb"] [ext_resource type="Texture2D" uid="uid://dystd8vvbqwo2" path="res://textures/exit.svg" id="7_jllve"] [ext_resource type="Texture2D" uid="uid://btn6ytky782a2" path="res://textures/star.svg" id="8_b00p6"] @@ -50,6 +51,7 @@ theme_override_font_sizes/font_size = 20 theme_override_styles/normal = SubResource("StyleBoxFlat_hyysn") theme_override_styles/focus = SubResource("StyleBoxFlat_hyysn") placeholder_text = "Search or enter address" +select_all_on_focus = true script = ExtResource("1_7ivk2") gate_events = ExtResource("2_13io8") @@ -59,10 +61,10 @@ layout_mode = 1 anchors_preset = 4 anchor_top = 0.5 anchor_bottom = 0.5 -offset_left = 10.0 -offset_top = -10.0 -offset_right = 30.0 -offset_bottom = 10.0 +offset_left = 12.0 +offset_top = -8.0 +offset_right = 28.0 +offset_bottom = 8.0 grow_vertical = 2 mouse_filter = 1 script = ExtResource("3_3p1re") @@ -85,7 +87,6 @@ texture = ExtResource("3_1rllf") expand_mode = 1 [node name="Downloading" type="TextureRect" parent="SearchStatus"] -visible = false self_modulate = Color(1, 1, 1, 0.8) layout_mode = 1 anchors_preset = 15 @@ -93,8 +94,13 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -texture = ExtResource("5_yhqf5") +pivot_offset = Vector2(8, 8) +texture = ExtResource("6_twd8p") expand_mode = 1 +script = ExtResource("6_fn1n3") +duration = 0.5 +start_scale = 0.5 +end_scale = 1.0 [node name="Success" type="TextureRect" parent="SearchStatus"] visible = false @@ -105,7 +111,7 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -texture = ExtResource("5_dqxpp") +texture = ExtResource("6_twd8p") expand_mode = 1 [node name="Error" type="TextureRect" parent="SearchStatus"] diff --git a/project/scripts/ui/search/download_animation.gd b/project/scripts/ui/search/download_animation.gd new file mode 100644 index 0000000..a5fd1a1 --- /dev/null +++ b/project/scripts/ui/search/download_animation.gd @@ -0,0 +1,24 @@ +extends TextureRect + +@export var duration: float +@export var start_scale: float +@export var end_scale: float + +@onready var start := Vector2(start_scale, start_scale) +@onready var end := Vector2(end_scale, end_scale) +@onready var default = scale + + +func _ready() -> void: + animate() + + +func _notification(what: int) -> void: + if what == NOTIFICATION_ENABLED: + animate() + + +func animate() -> void: + var tween = create_tween().set_loops() + tween.tween_property(self, "scale", end, duration).from(start) + tween.tween_property(self, "scale", start, duration).from(end) diff --git a/project/scripts/ui/search/search_status.gd b/project/scripts/ui/search/search_status.gd index 6d4b0cd..9dd0874 100644 --- a/project/scripts/ui/search/search_status.gd +++ b/project/scripts/ui/search/search_status.gd @@ -11,6 +11,7 @@ extends Control func _ready() -> void: search_line_edit.text_changed.connect(func(_text): switch_to(search)) + gate_events.search.connect(func(_url): switch_to(search)) gate_events.exit_gate.connect(func(): switch_to(search)) gate_events.open_gate.connect(func(_url): switch_to(downloading)) gate_events.gate_entered.connect(func(): switch_to(success)) diff --git a/project/textures/gate.svg b/project/textures/gate.svg new file mode 100755 index 0000000..efd0459 --- /dev/null +++ b/project/textures/gate.svg @@ -0,0 +1,60 @@ + + + + + + + + + + diff --git a/project/textures/gate.svg.import b/project/textures/gate.svg.import new file mode 100644 index 0000000..e9836ac --- /dev/null +++ b/project/textures/gate.svg.import @@ -0,0 +1,37 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://cx3xxaqo3s3eq" +path="res://.godot/imported/gate.svg-9bc7e6deb01386cc22f9c4279c34c183.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://textures/gate.svg" +dest_files=["res://.godot/imported/gate.svg-9bc7e6deb01386cc22f9c4279c34c183.ctex"] + +[params] + +compress/mode=0 +compress/high_quality=false +compress/lossy_quality=0.7 +compress/hdr_compression=1 +compress/normal_map=0 +compress/channel_pack=0 +mipmaps/generate=true +mipmaps/limit=-1 +roughness/mode=0 +roughness/src_normal="" +process/fix_alpha_border=true +process/premult_alpha=false +process/normal_map_invert_y=false +process/hdr_as_srgb=false +process/hdr_clamp_exposure=false +process/size_limit=0 +detect_3d/compress_to=1 +svg/scale=1.0 +editor/scale_with_editor_scale=false +editor/convert_colors_with_editor_theme=false diff --git a/project/textures/search.svg b/project/textures/search.svg index 204c310..68e2b7b 100644 --- a/project/textures/search.svg +++ b/project/textures/search.svg @@ -1 +1,61 @@ - \ No newline at end of file + + + + + + + + + +