diff --git a/project/PexelsQD/Main/SpinBoxTimeInput.gd b/project/PexelsQD/Main/SpinBoxTimeInput.gd index 424c3b9..201a366 100644 --- a/project/PexelsQD/Main/SpinBoxTimeInput.gd +++ b/project/PexelsQD/Main/SpinBoxTimeInput.gd @@ -1,6 +1,6 @@ extends SpinBox -const PATTERN := "^(\\d{1,3}) s$" +const PATTERN := "^(\\d{1,3})$" var regex := RegEx.new() var old_text := "" @@ -16,6 +16,10 @@ func _ready() -> void: old_text = le.text +func _on_CheckBoxTime_toggled(is_button_pressed: bool) -> void: + min_value = 1 if is_button_pressed else 5 + + func _on_LineEdit_text_changed(new_text: String) -> void: var old_caret_position := le.caret_position var regex_match := regex.search(new_text) diff --git a/project/PexelsQD/PexelsQD.gd b/project/PexelsQD/PexelsQD.gd index acd636c..6b1706a 100644 --- a/project/PexelsQD/PexelsQD.gd +++ b/project/PexelsQD/PexelsQD.gd @@ -31,6 +31,7 @@ onready var tb_next: TextureButton = $PanelContainerIntro/CenterContainer/VBoxCo onready var vbc_main: VBoxContainer = $VBoxContainerMain onready var le_search: LineEdit = $VBoxContainerMain/HBoxContainerControls/LineEditSearch onready var sb_time_input: SpinBox = $VBoxContainerMain/HBoxContainerControls/SpinBoxTimeInput +onready var cb_time: CheckButton = $VBoxContainerMain/HBoxContainerControls/CheckButtonTime onready var tb_back: TextureButton = $VBoxContainerMain/HBoxContainerControls/TextureButtonBack onready var tb_skip_back: TextureButton = $VBoxContainerMain/HBoxContainerControls/TextureButtonSkipBack onready var tb_rewind: TextureButton = $VBoxContainerMain/HBoxContainerControls/TextureButtonRewind @@ -65,6 +66,7 @@ func _ready() -> void: tb_back.connect("pressed", tb_play_pause, "set_pressed", [false]) le_search.connect("text_entered", self, "_on_LineEditSearch_text_entered") le_search.connect("text_validated", self, "_on_LineEditSearch_text_validated") + cb_time.connect("toggled", sb_time_input, "_on_CheckBoxTime_toggled") tb_skip_back.connect("pressed", self, "_seek", [0, false]) tb_rewind.connect("pressed", self, "_seek", [-Constants.DELTA]) tb_fast_forward.connect("pressed", self, "_seek", [Constants.DELTA]) @@ -147,13 +149,14 @@ func _search() -> void: var photo = yield(_session.search(le_search.text), "completed") match [photo, tb_play_pause.pressed]: [{"texture": var texture, ..}, true]: + var time: float = sb_time_input.value * (60 if cb_time.pressed else 1) tween.remove_all() pc_info.refresh(photo) tr_image.texture = texture - pb.max_value = sb_time_input.value - tween.interpolate_property(pb, "value", pb.min_value, pb.max_value, sb_time_input.value) - tween.interpolate_property(pb, "modulate", PB_COLORS.begin, PB_COLORS.end, sb_time_input.value - LAST, Tween.TRANS_SINE, Tween.EASE_IN) - tween.interpolate_property(pb, "modulate", PB_COLORS.end, PB_COLORS.last, LAST, Tween.TRANS_LINEAR, Tween.EASE_IN, sb_time_input.value - LAST) + pb.max_value = time + tween.interpolate_property(pb, "value", pb.min_value, pb.max_value, time) + tween.interpolate_property(pb, "modulate", PB_COLORS.begin, PB_COLORS.end, time - LAST, Tween.TRANS_SINE, Tween.EASE_IN) + tween.interpolate_property(pb, "modulate", PB_COLORS.end, PB_COLORS.last, LAST, Tween.TRANS_LINEAR, Tween.EASE_IN, time - LAST) tween.start() [{"error": var error}, _]: _notify(error) diff --git a/project/PexelsQD/PexelsQD.tscn b/project/PexelsQD/PexelsQD.tscn index f858031..dddf7f6 100644 --- a/project/PexelsQD/PexelsQD.tscn +++ b/project/PexelsQD/PexelsQD.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=64 format=2] +[gd_scene load_steps=68 format=2] [ext_resource path="res://PexelsQD/Main/SpinBoxTimeInput.gd" type="Script" id=1] [ext_resource path="res://assets/nord.tres" type="Theme" id=2] @@ -42,6 +42,10 @@ [ext_resource path="res://PexelsQD/Main/TextureButtonPlayPause.gd" type="Script" id=40] [ext_resource path="res://assets/icons/help-circle-hover.svg" type="Texture" id=41] [ext_resource path="res://assets/icons/help-circle.svg" type="Texture" id=42] +[ext_resource path="res://assets/icons/check-button-time/on.png" type="Texture" id=43] +[ext_resource path="res://assets/icons/check-button-time/off.png" type="Texture" id=44] +[ext_resource path="res://assets/icons/check-button-time/off-disabled.png" type="Texture" id=45] +[ext_resource path="res://assets/icons/check-button-time/on-disabled.png" type="Texture" id=46] [sub_resource type="InputEventAction" id=1] action = "ui_left" @@ -132,11 +136,11 @@ __meta__ = { [node name="HBoxContainerControls" type="HBoxContainer" parent="VBoxContainerMain"] margin_right = 1008.0 -margin_bottom = 34.0 +margin_bottom = 36.0 [node name="TextureButtonBack" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_right = 24.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 0 ) focus_mode = 0 shortcut_in_tooltip = false @@ -149,28 +153,36 @@ stretch_mode = 5 [node name="LineEditSearch" type="LineEdit" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 28.0 -margin_right = 576.0 -margin_bottom = 34.0 +margin_right = 484.0 +margin_bottom = 36.0 size_flags_horizontal = 3 max_length = 60 script = ExtResource( 5 ) [node name="SpinBoxTimeInput" type="SpinBox" parent="VBoxContainerMain/HBoxContainerControls"] -margin_left = 580.0 -margin_right = 680.0 -margin_bottom = 34.0 +margin_left = 488.0 +margin_right = 588.0 +margin_bottom = 36.0 min_value = 5.0 max_value = 999.0 value = 60.0 rounded = true align = 2 -suffix = "s" script = ExtResource( 1 ) +[node name="CheckButtonTime" type="CheckButton" parent="VBoxContainerMain/HBoxContainerControls"] +margin_left = 592.0 +margin_right = 680.0 +margin_bottom = 36.0 +custom_icons/off = ExtResource( 44 ) +custom_icons/on_disabled = ExtResource( 46 ) +custom_icons/on = ExtResource( 43 ) +custom_icons/off_disabled = ExtResource( 45 ) + [node name="TextureButtonSkipBack" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 684.0 margin_right = 708.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 0 ) focus_mode = 0 shortcut_in_tooltip = false @@ -184,7 +196,7 @@ stretch_mode = 5 [node name="TextureButtonRewind" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 712.0 margin_right = 736.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 0 ) focus_mode = 0 shortcut_in_tooltip = false @@ -198,7 +210,7 @@ stretch_mode = 5 [node name="TextureButtonPlayPause" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 740.0 margin_right = 764.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 0 ) focus_mode = 0 disabled = true @@ -215,7 +227,7 @@ script = ExtResource( 40 ) [node name="TextureButtonStop" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 768.0 margin_right = 792.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 0 ) focus_mode = 0 shortcut_in_tooltip = false @@ -229,7 +241,7 @@ stretch_mode = 5 [node name="TextureButtonFastForward" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 796.0 margin_right = 820.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 0 ) focus_mode = 0 shortcut_in_tooltip = false @@ -243,7 +255,7 @@ stretch_mode = 5 [node name="TextureButtonSkipForward" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 824.0 margin_right = 848.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 0 ) focus_mode = 0 shortcut_in_tooltip = false @@ -257,7 +269,7 @@ stretch_mode = 5 [node name="TextureButtonInfo" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 852.0 margin_right = 876.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 24 ) focus_mode = 0 toggle_mode = true @@ -275,7 +287,7 @@ __meta__ = { [node name="TextureButtonHelp" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 880.0 margin_right = 904.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 24 ) toggle_mode = true shortcut_in_tooltip = false @@ -292,12 +304,12 @@ __meta__ = { [node name="VSeparator" type="VSeparator" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 908.0 margin_right = 912.0 -margin_bottom = 34.0 +margin_bottom = 36.0 [node name="TextureButtonRazcore" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 916.0 margin_right = 940.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 24, 24 ) focus_mode = 0 mouse_default_cursor_shape = 2 @@ -309,7 +321,7 @@ stretch_mode = 5 [node name="TextureButtonPexels" type="TextureButton" parent="VBoxContainerMain/HBoxContainerControls"] margin_left = 944.0 margin_right = 1008.0 -margin_bottom = 34.0 +margin_bottom = 36.0 rect_min_size = Vector2( 64, 8 ) focus_mode = 0 mouse_default_cursor_shape = 2 @@ -319,14 +331,14 @@ expand = true stretch_mode = 5 [node name="ProgressBar" type="ProgressBar" parent="VBoxContainerMain"] -margin_top = 44.0 +margin_top = 46.0 margin_right = 1008.0 -margin_bottom = 49.0 +margin_bottom = 51.0 rect_min_size = Vector2( 0, 5 ) percent_visible = false [node name="TextureRectImage" type="TextureRect" parent="VBoxContainerMain"] -margin_top = 59.0 +margin_top = 61.0 margin_right = 1008.0 margin_bottom = 592.0 grow_horizontal = 2 diff --git a/project/assets/icons/check-button-time/off-disabled.png b/project/assets/icons/check-button-time/off-disabled.png new file mode 100644 index 0000000..b4dc15b Binary files /dev/null and b/project/assets/icons/check-button-time/off-disabled.png differ diff --git a/project/assets/icons/check-button-time/off-disabled.png.import b/project/assets/icons/check-button-time/off-disabled.png.import new file mode 100644 index 0000000..a171bb1 --- /dev/null +++ b/project/assets/icons/check-button-time/off-disabled.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/off-disabled.png-f730e2f4761ef8895392e1d4a723e67b.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/check-button-time/off-disabled.png" +dest_files=[ "res://.import/off-disabled.png-f730e2f4761ef8895392e1d4a723e67b.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project/assets/icons/check-button-time/off.png b/project/assets/icons/check-button-time/off.png new file mode 100644 index 0000000..27da644 Binary files /dev/null and b/project/assets/icons/check-button-time/off.png differ diff --git a/project/assets/icons/check-button-time/off.png.import b/project/assets/icons/check-button-time/off.png.import new file mode 100644 index 0000000..a3608ce --- /dev/null +++ b/project/assets/icons/check-button-time/off.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/off.png-7db6533eb2befcaab3fa4e92e2d2ab9c.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/check-button-time/off.png" +dest_files=[ "res://.import/off.png-7db6533eb2befcaab3fa4e92e2d2ab9c.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project/assets/icons/check-button-time/on-disabled.png b/project/assets/icons/check-button-time/on-disabled.png new file mode 100644 index 0000000..4103309 Binary files /dev/null and b/project/assets/icons/check-button-time/on-disabled.png differ diff --git a/project/assets/icons/check-button-time/on-disabled.png.import b/project/assets/icons/check-button-time/on-disabled.png.import new file mode 100644 index 0000000..a8cffac --- /dev/null +++ b/project/assets/icons/check-button-time/on-disabled.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/on-disabled.png-ebf4910c5512bff3f7e3d7c9c1eb8174.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/check-button-time/on-disabled.png" +dest_files=[ "res://.import/on-disabled.png-ebf4910c5512bff3f7e3d7c9c1eb8174.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project/assets/icons/check-button-time/on.png b/project/assets/icons/check-button-time/on.png new file mode 100644 index 0000000..dc57507 Binary files /dev/null and b/project/assets/icons/check-button-time/on.png differ diff --git a/project/assets/icons/check-button-time/on.png.import b/project/assets/icons/check-button-time/on.png.import new file mode 100644 index 0000000..7072dcd --- /dev/null +++ b/project/assets/icons/check-button-time/on.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="StreamTexture" +path="res://.import/on.png-4e7c36665425968ae3acc4c568f5ea88.stex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/icons/check-button-time/on.png" +dest_files=[ "res://.import/on.png-4e7c36665425968ae3acc4c568f5ea88.stex" ] + +[params] + +compress/mode=0 +compress/lossy_quality=0.7 +compress/hdr_mode=0 +compress/bptc_ldr=0 +compress/normal_map=0 +flags/repeat=0 +flags/filter=true +flags/mipmaps=false +flags/anisotropic=false +flags/srgb=2 +process/fix_alpha_border=true +process/premult_alpha=false +process/HDR_as_SRGB=false +process/invert_color=false +stream=false +size_limit=0 +detect_3d=true +svg/scale=1.0 diff --git a/project/assets/triton-16.hex b/project/assets/triton-16.hex deleted file mode 100644 index acbfa5f..0000000 --- a/project/assets/triton-16.hex +++ /dev/null @@ -1,16 +0,0 @@ -000000 -2b2232 -473759 -98879f -232433 -5f6f87 -829eb3 -93abc2 -1a2120 -424849 -5e7173 -c3b3c8 -866273 -a2878a -b09ea0 -daced3