From deb9f6f1f72d7b47e5764b83f6d00be0e674874e Mon Sep 17 00:00:00 2001 From: Mylloon Date: Sun, 26 Feb 2023 19:09:57 +0100 Subject: [PATCH] * update filter * add winning screen --- Assets/cursor/0.png | 4 +- Assets/cursor/0.png.import | 2 +- Assets/dossier/0.png.import | 2 +- Assets/dossier/1.png.import | 2 +- Assets/skin_assets/button_focus.png | 3 -- Assets/skin_assets/button_focus.png.import | 35 -------------- Assets/skin_assets/button_normal.png | 3 -- Assets/skin_assets/button_normal.png.import | 35 -------------- Assets/skin_assets/button_pressed.png | 3 -- Assets/skin_assets/button_pressed.png.import | 35 -------------- Assets/tres_button/hover-pressed.png.import | 2 +- Assets/tres_button/normal.png.import | 2 +- Assets/victory/0.png | 3 ++ .../0.png.import} | 6 +-- Assets/windows/folder_rect.png.import | 2 +- Assets/windows/folder_square.png.import | 2 +- Assets/windows/window_main.png.import | 2 +- Assets/windows/windows.png | 3 -- Elements/Scripts/Directory.gd | 4 ++ Elements/Scripts/WindowHeader.gd | 4 ++ Elements/SquareWindow.tscn | 6 +-- Musics/wav/defeat.wav.import | 2 +- Musics/wav/victory.wav.import | 2 +- Scenes/Scripts/Button_Node2D.gd | 2 +- Scenes/Scripts/Desktop.gd | 16 +++++-- Scenes/victory.tscn | 46 +++++++++++++++++++ 26 files changed, 88 insertions(+), 140 deletions(-) delete mode 100644 Assets/skin_assets/button_focus.png delete mode 100755 Assets/skin_assets/button_focus.png.import delete mode 100644 Assets/skin_assets/button_normal.png delete mode 100755 Assets/skin_assets/button_normal.png.import delete mode 100644 Assets/skin_assets/button_pressed.png delete mode 100755 Assets/skin_assets/button_pressed.png.import create mode 100755 Assets/victory/0.png rename Assets/{windows/windows.png.import => victory/0.png.import} (71%) delete mode 100644 Assets/windows/windows.png mode change 100644 => 100755 Musics/wav/defeat.wav.import mode change 100644 => 100755 Musics/wav/victory.wav.import create mode 100755 Scenes/victory.tscn diff --git a/Assets/cursor/0.png b/Assets/cursor/0.png index 50044be..bbe9630 100755 --- a/Assets/cursor/0.png +++ b/Assets/cursor/0.png @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:091b507885cc8715b446af2cbcdc2f4471ee62214bd8a9fccc470d5d838e1a55 -size 10929 +oid sha256:dfbfbde152446be9fe2d13fa181eee967c53c8927fd320333354f4fd5c57e3d8 +size 15687 diff --git a/Assets/cursor/0.png.import b/Assets/cursor/0.png.import index 5765b37..daed303 100755 --- a/Assets/cursor/0.png.import +++ b/Assets/cursor/0.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/dossier/0.png.import b/Assets/dossier/0.png.import index aa09e83..f08a1c1 100755 --- a/Assets/dossier/0.png.import +++ b/Assets/dossier/0.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/dossier/1.png.import b/Assets/dossier/1.png.import index fd58375..6abd76a 100755 --- a/Assets/dossier/1.png.import +++ b/Assets/dossier/1.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/skin_assets/button_focus.png b/Assets/skin_assets/button_focus.png deleted file mode 100644 index d213974..0000000 --- a/Assets/skin_assets/button_focus.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:fe98dd8356385014857fa7b0f3f75792fd63bdf6a5e2f8d1942444775aa99b00 -size 219 diff --git a/Assets/skin_assets/button_focus.png.import b/Assets/skin_assets/button_focus.png.import deleted file mode 100755 index e4407cc..0000000 --- a/Assets/skin_assets/button_focus.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/button_focus.png-e1981e994155ca422d4d953f4af77164.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://Assets/skin_assets/button_focus.png" -dest_files=[ "res://.import/button_focus.png-e1981e994155ca422d4d953f4af77164.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 -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/Assets/skin_assets/button_normal.png b/Assets/skin_assets/button_normal.png deleted file mode 100644 index 82123c3..0000000 --- a/Assets/skin_assets/button_normal.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e29606a5584bcfa57c9546348197ac17867a5022a2afcd0121f4808494bca56c -size 209 diff --git a/Assets/skin_assets/button_normal.png.import b/Assets/skin_assets/button_normal.png.import deleted file mode 100755 index cbb6a2f..0000000 --- a/Assets/skin_assets/button_normal.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/button_normal.png-7ceacf3d6625a4e76f581d0ae1258671.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://Assets/skin_assets/button_normal.png" -dest_files=[ "res://.import/button_normal.png-7ceacf3d6625a4e76f581d0ae1258671.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 -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/Assets/skin_assets/button_pressed.png b/Assets/skin_assets/button_pressed.png deleted file mode 100644 index 63f06f5..0000000 --- a/Assets/skin_assets/button_pressed.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:3b8d5641895fa3c2ef6bf7260f845566a151f16561e3c9e17c557480d3fce499 -size 216 diff --git a/Assets/skin_assets/button_pressed.png.import b/Assets/skin_assets/button_pressed.png.import deleted file mode 100755 index 845fb8c..0000000 --- a/Assets/skin_assets/button_pressed.png.import +++ /dev/null @@ -1,35 +0,0 @@ -[remap] - -importer="texture" -type="StreamTexture" -path="res://.import/button_pressed.png-501e49eae0845aa00c0264094791a5b9.stex" -metadata={ -"vram_texture": false -} - -[deps] - -source_file="res://Assets/skin_assets/button_pressed.png" -dest_files=[ "res://.import/button_pressed.png-501e49eae0845aa00c0264094791a5b9.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 -process/normal_map_invert_y=false -stream=false -size_limit=0 -detect_3d=true -svg/scale=1.0 diff --git a/Assets/tres_button/hover-pressed.png.import b/Assets/tres_button/hover-pressed.png.import index 7283c23..b16a2d3 100755 --- a/Assets/tres_button/hover-pressed.png.import +++ b/Assets/tres_button/hover-pressed.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/tres_button/normal.png.import b/Assets/tres_button/normal.png.import index 06485e3..aebd07a 100755 --- a/Assets/tres_button/normal.png.import +++ b/Assets/tres_button/normal.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/victory/0.png b/Assets/victory/0.png new file mode 100755 index 0000000..b56484b --- /dev/null +++ b/Assets/victory/0.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:9f87e2a1492954882122f7d437e464cb23ff58356159f821a08b7f00d0b5009b +size 1658010 diff --git a/Assets/windows/windows.png.import b/Assets/victory/0.png.import similarity index 71% rename from Assets/windows/windows.png.import rename to Assets/victory/0.png.import index fbf0da1..5c094e0 100755 --- a/Assets/windows/windows.png.import +++ b/Assets/victory/0.png.import @@ -2,15 +2,15 @@ importer="texture" type="StreamTexture" -path="res://.import/windows.png-63993ca9c59f37e0ad00b5a6a909cb20.stex" +path="res://.import/0.png-f61ab1ba888641d55763745d59bbb671.stex" metadata={ "vram_texture": false } [deps] -source_file="res://Assets/windows/windows.png" -dest_files=[ "res://.import/windows.png-63993ca9c59f37e0ad00b5a6a909cb20.stex" ] +source_file="res://Assets/victory/0.png" +dest_files=[ "res://.import/0.png-f61ab1ba888641d55763745d59bbb671.stex" ] [params] diff --git a/Assets/windows/folder_rect.png.import b/Assets/windows/folder_rect.png.import index 9b21df7..b5c8e8c 100755 --- a/Assets/windows/folder_rect.png.import +++ b/Assets/windows/folder_rect.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/windows/folder_square.png.import b/Assets/windows/folder_square.png.import index c4f363d..4547b74 100755 --- a/Assets/windows/folder_square.png.import +++ b/Assets/windows/folder_square.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/windows/window_main.png.import b/Assets/windows/window_main.png.import index 5e618f5..10a5076 100755 --- a/Assets/windows/window_main.png.import +++ b/Assets/windows/window_main.png.import @@ -20,7 +20,7 @@ compress/hdr_mode=0 compress/bptc_ldr=0 compress/normal_map=0 flags/repeat=0 -flags/filter=true +flags/filter=false flags/mipmaps=false flags/anisotropic=false flags/srgb=2 diff --git a/Assets/windows/windows.png b/Assets/windows/windows.png deleted file mode 100644 index 979e066..0000000 --- a/Assets/windows/windows.png +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:4b0fedd299f828484743899316a68b4edf9dfb88815fefaff5818f7209b85b26 -size 3966 diff --git a/Elements/Scripts/Directory.gd b/Elements/Scripts/Directory.gd index a854e1e..351a41b 100755 --- a/Elements/Scripts/Directory.gd +++ b/Elements/Scripts/Directory.gd @@ -10,3 +10,7 @@ func _on_Area2D_input_event(_viewport: Node, event: InputEvent, _shape_idx: int) if event.pressed and event.button_index == BUTTON_LEFT: screen.visible = true sprite.modulate = Color(0.66, 0.51, 0.85) # shade + var progress_screen = screen.get_node("Window2") + if progress_screen.visible: + progress_screen.play() + screen.get_node("Button2").etat = true diff --git a/Elements/Scripts/WindowHeader.gd b/Elements/Scripts/WindowHeader.gd index 7486ede..e85ea35 100755 --- a/Elements/Scripts/WindowHeader.gd +++ b/Elements/Scripts/WindowHeader.gd @@ -39,3 +39,7 @@ func _on_Area2D2_input_event(_viewport: Node, event: InputEvent, _shape_idx: int drag_change_state() window.visible = false folder_icon.modulate = Color(1, 1, 1) # reset shade + var progress_screen = window.get_node("Window2") + if progress_screen.visible: + progress_screen.stop() + window.get_node("Button2").etat = false diff --git a/Elements/SquareWindow.tscn b/Elements/SquareWindow.tscn index f6a083d..1b6725a 100755 --- a/Elements/SquareWindow.tscn +++ b/Elements/SquareWindow.tscn @@ -16,9 +16,9 @@ extents = Vector2( 38.75, 38.75 ) [sub_resource type="SpriteFrames" id=3] animations = [ { "frames": [ ExtResource( 6 ), ExtResource( 3 ), ExtResource( 4 ), ExtResource( 5 ) ], -"loop": true, +"loop": false, "name": "default", -"speed": 5.0 +"speed": 1.0 } ] [node name="Node2D" type="Node2D"] @@ -50,8 +50,6 @@ visible = false position = Vector2( 56, -12 ) scale = Vector2( 0.4, 0.4 ) frames = SubResource( 3 ) -frame = 2 -playing = true [node name="Area2D" type="Area2D" parent="Window2"] position = Vector2( 487.5, -490 ) diff --git a/Musics/wav/defeat.wav.import b/Musics/wav/defeat.wav.import old mode 100644 new mode 100755 index dc954cf..586ca75 --- a/Musics/wav/defeat.wav.import +++ b/Musics/wav/defeat.wav.import @@ -17,7 +17,7 @@ force/max_rate=false force/max_rate_hz=44100 edit/trim=false edit/normalize=false -edit/loop_mode=1 +edit/loop_mode=2 edit/loop_begin=0 edit/loop_end=-1 compress/mode=0 diff --git a/Musics/wav/victory.wav.import b/Musics/wav/victory.wav.import old mode 100644 new mode 100755 index 72d9338..e461414 --- a/Musics/wav/victory.wav.import +++ b/Musics/wav/victory.wav.import @@ -17,7 +17,7 @@ force/max_rate=false force/max_rate_hz=44100 edit/trim=false edit/normalize=false -edit/loop_mode=0 +edit/loop_mode=2 edit/loop_begin=0 edit/loop_end=-1 compress/mode=0 diff --git a/Scenes/Scripts/Button_Node2D.gd b/Scenes/Scripts/Button_Node2D.gd index 6bb2425..e0c8b64 100755 --- a/Scenes/Scripts/Button_Node2D.gd +++ b/Scenes/Scripts/Button_Node2D.gd @@ -3,7 +3,7 @@ extends Button onready var villain = $"../../../Villain/AnimatedSprite" onready var villain_animations = $"../../../Villain" -var etat = false +export(bool) var etat = false var remplissage = 0 const texture_pressed = preload("res://Assets/tres_button/hover-pressed.png") const texture_released = preload("res://Assets/tres_button/normal.png") diff --git a/Scenes/Scripts/Desktop.gd b/Scenes/Scripts/Desktop.gd index ef4daac..92d07fd 100755 --- a/Scenes/Scripts/Desktop.gd +++ b/Scenes/Scripts/Desktop.gd @@ -35,9 +35,8 @@ func _ready() -> void: # Background (window) window.get_node("Window").visible = false window.get_node("Window2").visible = true - # Change button text - button_window.text = "." - + # Change button visibility + button_window.visible = false button_window.focus_mode = Button.FOCUS_NONE dossier.position = Vector2(dossier.position.x, dossier.position.y + 150 * (i + 1)) @@ -58,3 +57,14 @@ func _process(_delta) -> void: else: mainMusic.set_volume_db(0) eyeMusic.set_volume_db(-80) + + var end = true + for i in self.get_children(): + if "Directory" in i.name: + if i.visible: + end = false + + if end: + mainMusic.set_volume_db(-80) + eyeMusic.set_volume_db(-80) + assert(get_tree().change_scene("res://Scenes/victory.tscn") == OK) diff --git a/Scenes/victory.tscn b/Scenes/victory.tscn new file mode 100755 index 0000000..2267a6c --- /dev/null +++ b/Scenes/victory.tscn @@ -0,0 +1,46 @@ +[gd_scene load_steps=9 format=2] + +[ext_resource path="res://Scenes/Scripts/GameOver.gd" type="Script" id=1] +[ext_resource path="res://Assets/victory/0.png" type="Texture" id=2] +[ext_resource path="res://Assets/tres_button/normal.tres" type="StyleBox" id=3] +[ext_resource path="res://Assets/tres_button/pressed.tres" type="StyleBox" id=4] +[ext_resource path="res://Assets/tres_button/hover.tres" type="StyleBox" id=5] +[ext_resource path="res://Musics/sound effect/hower.wav" type="AudioStream" id=6] +[ext_resource path="res://Assets/skin_assets/menu_font.tres" type="DynamicFont" id=7] +[ext_resource path="res://Musics/wav/victory.wav" type="AudioStream" id=8] + +[node name="Node2D" type="Node2D"] +script = ExtResource( 1 ) + +[node name="Windows" type="Sprite" parent="."] +position = Vector2( 512, 360 ) +scale = Vector2( 0.5, 0.5 ) +z_index = -2 +texture = ExtResource( 2 ) + +[node name="RestartButton" type="Button" parent="."] +margin_left = 312.0 +margin_top = 632.0 +margin_right = 724.0 +margin_bottom = 693.0 +focus_mode = 0 +custom_colors/font_color = Color( 1, 1, 1, 1 ) +custom_colors/font_color_hover = Color( 0.941176, 0.690196, 0.403922, 1 ) +custom_fonts/font = ExtResource( 7 ) +custom_styles/hover = ExtResource( 5 ) +custom_styles/pressed = ExtResource( 4 ) +custom_styles/normal = ExtResource( 3 ) +text = "Back to main menu" +__meta__ = { +"_edit_use_anchors_": true +} + +[node name="VictoryMusic" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 8 ) +autoplay = true + +[node name="Hover" type="AudioStreamPlayer" parent="."] +stream = ExtResource( 6 ) + +[connection signal="mouse_entered" from="RestartButton" to="." method="_on_RestartButton_mouse_entered"] +[connection signal="pressed" from="RestartButton" to="." method="_on_RestartButton_pressed"]