diff --git a/assets/3d/main_menu_mocup.blend b/assets/3d/main_menu_mocup.blend new file mode 100644 index 0000000..6fd11ae Binary files /dev/null and b/assets/3d/main_menu_mocup.blend differ diff --git a/assets/shaders/SACRIFICE.gdshader b/assets/shaders/SACRIFICE.gdshader index 3946bef..88ffc92 100644 --- a/assets/shaders/SACRIFICE.gdshader +++ b/assets/shaders/SACRIFICE.gdshader @@ -13,5 +13,5 @@ void fragment() { { COLOR.rgb = vec3(255.0/255.0,127.0/255.0,80.0/255.0); } - COLOR.a = COLOR.a*texture(noise,UV).a; + COLOR.a = step(0.4 + 0.05 * sin((TIME+1.0)/4.0),COLOR.a*texture(noise,UV).a); } diff --git a/assets/sprites/atlases/atlas1.png b/assets/sprites/atlases/atlas1.png index 7b91a63..cfb102a 100644 Binary files a/assets/sprites/atlases/atlas1.png and b/assets/sprites/atlases/atlas1.png differ diff --git a/assets/sprites/cone2.tres b/assets/sprites/cone2.tres index b14c7e2..04f93eb 100644 --- a/assets/sprites/cone2.tres +++ b/assets/sprites/cone2.tres @@ -4,4 +4,4 @@ [resource] atlas = ExtResource("1_au0m1") -region = Rect2(31, 1, 31, 32) +region = Rect2(31, 0, 31, 33) diff --git a/assets/sprites/cone3.tres b/assets/sprites/cone3.tres index abd2df8..16d85ac 100644 --- a/assets/sprites/cone3.tres +++ b/assets/sprites/cone3.tres @@ -4,4 +4,4 @@ [resource] atlas = ExtResource("1_rrcfd") -region = Rect2(62, 11, 31, 22) +region = Rect2(62, 0, 31, 33) diff --git a/assets/sprites/gui/ChooseYourSeeds/PremiumFrameField.tres b/assets/sprites/gui/ChooseYourSeeds/PremiumFrameField.tres new file mode 100644 index 0000000..d2740ab --- /dev/null +++ b/assets/sprites/gui/ChooseYourSeeds/PremiumFrameField.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://c35dr3hiy66k0"] + +[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_6j62c"] + +[resource] +atlas = ExtResource("1_6j62c") +region = Rect2(576, 0, 65, 65) diff --git a/assets/sprites/gui/DisabledEmptyCard.png b/assets/sprites/gui/DisabledEmptyCard.png deleted file mode 100644 index 358042a..0000000 Binary files a/assets/sprites/gui/DisabledEmptyCard.png and /dev/null differ diff --git a/assets/sprites/gui/PremiumPlantCard.tres b/assets/sprites/gui/PremiumPlantCard.tres new file mode 100644 index 0000000..619631b --- /dev/null +++ b/assets/sprites/gui/PremiumPlantCard.tres @@ -0,0 +1,7 @@ +[gd_resource type="AtlasTexture" load_steps=2 format=3 uid="uid://31jc2e7dijas"] + +[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_5bxlp"] + +[resource] +atlas = ExtResource("1_5bxlp") +region = Rect2(351, 65, 41, 56) diff --git a/assets/sprites/gui/main_menu_buttons.png b/assets/sprites/gui/main_menu_buttons.png new file mode 100644 index 0000000..ce43b6e Binary files /dev/null and b/assets/sprites/gui/main_menu_buttons.png differ diff --git a/assets/sprites/gui/DisabledEmptyCard.png.import b/assets/sprites/gui/main_menu_buttons.png.import similarity index 66% rename from assets/sprites/gui/DisabledEmptyCard.png.import rename to assets/sprites/gui/main_menu_buttons.png.import index ac3a262..4f431a2 100644 --- a/assets/sprites/gui/DisabledEmptyCard.png.import +++ b/assets/sprites/gui/main_menu_buttons.png.import @@ -2,16 +2,16 @@ importer="texture" type="CompressedTexture2D" -uid="uid://cxlr34yh0bqch" -path="res://.godot/imported/DisabledEmptyCard.png-7f5482b96bf2d482bb3d5df447102c95.ctex" +uid="uid://cmcwrgcm272gy" +path="res://.godot/imported/main_menu_buttons.png-879fc80bdc55423878339132e84ccb38.ctex" metadata={ "vram_texture": false } [deps] -source_file="res://assets/sprites/gui/DisabledEmptyCard.png" -dest_files=["res://.godot/imported/DisabledEmptyCard.png-7f5482b96bf2d482bb3d5df447102c95.ctex"] +source_file="res://assets/sprites/gui/main_menu_buttons.png" +dest_files=["res://.godot/imported/main_menu_buttons.png-879fc80bdc55423878339132e84ccb38.ctex"] [params] diff --git a/assets/sprites/menu_bg.ase b/assets/sprites/menu_bg.ase new file mode 100644 index 0000000..79e1e01 Binary files /dev/null and b/assets/sprites/menu_bg.ase differ diff --git a/assets/sprites/menu_bg.png b/assets/sprites/menu_bg.png new file mode 100644 index 0000000..02b3f00 Binary files /dev/null and b/assets/sprites/menu_bg.png differ diff --git a/assets/sprites/menu_bg.png.import b/assets/sprites/menu_bg.png.import new file mode 100644 index 0000000..ebb6119 --- /dev/null +++ b/assets/sprites/menu_bg.png.import @@ -0,0 +1,34 @@ +[remap] + +importer="texture" +type="CompressedTexture2D" +uid="uid://c37pvdhol2x02" +path="res://.godot/imported/menu_bg.png-9478556fe857b797a39f623531c087e9.ctex" +metadata={ +"vram_texture": false +} + +[deps] + +source_file="res://assets/sprites/menu_bg.png" +dest_files=["res://.godot/imported/menu_bg.png-9478556fe857b797a39f623531c087e9.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=false +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 diff --git a/project.godot b/project.godot index d09d382..dfa4949 100644 --- a/project.godot +++ b/project.godot @@ -48,6 +48,10 @@ folder_colors={ "res://scripts/": "blue" } +[filesystem] + +import/blender/enabled=false + [gui] theme/custom="res://resources/themes/GameStyle.tres" diff --git a/resources/plants/Aloe.tres b/resources/plants/Aloe.tres index f0d01af..0240395 100644 --- a/resources/plants/Aloe.tres +++ b/resources/plants/Aloe.tres @@ -1,8 +1,20 @@ -[gd_resource type="Resource" script_class="PlantResource" load_steps=4 format=3 uid="uid://bf7vjtufjc8kt"] +[gd_resource type="Resource" script_class="PlantResource" load_steps=9 format=3 uid="uid://bf7vjtufjc8kt"] [ext_resource type="Texture2D" uid="uid://d4btl7vqi4v0q" path="res://assets/sprites/plants/aloe.tres" id="1_t4137"] [ext_resource type="Script" uid="uid://cyenlko1knygw" path="res://scripts/resources/PlantResource.cs" id="1_vw2kg"] [ext_resource type="PackedScene" uid="uid://bw1w8jp0yeypy" path="res://scenes/entities/plants/aloe.tscn" id="2_6a4ia"] +[ext_resource type="Texture2D" uid="uid://c35dr3hiy66k0" path="res://assets/sprites/gui/ChooseYourSeeds/PremiumFrameField.tres" id="3_2s3af"] +[ext_resource type="Texture2D" uid="uid://31jc2e7dijas" path="res://assets/sprites/gui/PremiumPlantCard.tres" id="3_vfv8g"] +[ext_resource type="Script" uid="uid://3m7xks3xq3hl" path="res://scripts/components/gui/seedpackets/CustomSeedpacketFrame.cs" id="4_d5nqg"] + +[sub_resource type="LabelSettings" id="LabelSettings_2s3af"] + +[sub_resource type="Resource" id="Resource_5me4i"] +script = ExtResource("4_d5nqg") +frame = ExtResource("3_vfv8g") +font = SubResource("LabelSettings_2s3af") +almanachField = ExtResource("3_2s3af") +metadata/_custom_type_script = "uid://3m7xks3xq3hl" [resource] script = ExtResource("1_vw2kg") @@ -18,3 +30,4 @@ ReloadTime = 15.0 ReloadProgress = 0.0 Preview = ExtResource("1_t4137") Layer = 1 +customFrame = SubResource("Resource_5me4i") diff --git a/resources/themes/MainMenu.tres b/resources/themes/MainMenu.tres new file mode 100644 index 0000000..a27f46e --- /dev/null +++ b/resources/themes/MainMenu.tres @@ -0,0 +1,44 @@ +[gd_resource type="Theme" load_steps=8 format=3 uid="uid://btulhvgwclket"] + +[ext_resource type="Texture2D" uid="uid://cmcwrgcm272gy" path="res://assets/sprites/gui/main_menu_buttons.png" id="1_jv7fv"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_132w1"] +atlas = ExtResource("1_jv7fv") +region = Rect2(96, 0, 48, 48) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_45124"] +texture = SubResource("AtlasTexture_132w1") +texture_margin_left = 15.0 +texture_margin_top = 15.0 +texture_margin_right = 15.0 +texture_margin_bottom = 15.0 + +[sub_resource type="AtlasTexture" id="AtlasTexture_n6pvk"] +atlas = ExtResource("1_jv7fv") +region = Rect2(0, 0, 48, 48) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_2hb1n"] +texture = SubResource("AtlasTexture_n6pvk") +texture_margin_left = 15.0 +texture_margin_top = 15.0 +texture_margin_right = 15.0 +texture_margin_bottom = 15.0 + +[sub_resource type="AtlasTexture" id="AtlasTexture_p1ypd"] +atlas = ExtResource("1_jv7fv") +region = Rect2(48, 0, 48, 48) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_fg17j"] +texture = SubResource("AtlasTexture_p1ypd") +texture_margin_left = 15.0 +texture_margin_top = 15.0 +texture_margin_right = 15.0 +texture_margin_bottom = 15.0 + +[resource] +Button/colors/font_color = Color(0.875, 0.875, 0.875, 1) +Button/colors/font_focus_color = Color(0.95, 0.95, 0.95, 1) +Button/colors/font_hover_color = Color(1, 1, 1, 1) +Button/styles/hover = SubResource("StyleBoxTexture_45124") +Button/styles/normal = SubResource("StyleBoxTexture_2hb1n") +Button/styles/pressed = SubResource("StyleBoxTexture_fg17j") diff --git a/scenes/gui/main_menu.tscn b/scenes/gui/main_menu.tscn deleted file mode 100644 index f8f90a9..0000000 --- a/scenes/gui/main_menu.tscn +++ /dev/null @@ -1,91 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://bfstrli64u23y"] - -[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_xbu81"] - -[sub_resource type="AtlasTexture" id="AtlasTexture_5pe7g"] -atlas = ExtResource("1_xbu81") -region = Rect2(226, 77, 18, 18) - -[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_jl0ue"] -texture = SubResource("AtlasTexture_5pe7g") -texture_margin_left = 6.0 -texture_margin_top = 6.0 -texture_margin_right = 6.0 -texture_margin_bottom = 6.0 - -[node name="MainMenu" type="Control"] -layout_mode = 3 -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 - -[node name="PrototypeWindow" type="AcceptDialog" parent="."] -title = "" -size = Vector2i(600, 400) -visible = true -unresizable = true -borderless = true -theme_override_styles/panel = SubResource("StyleBoxTexture_jl0ue") -ok_button_text = "Let's go" -dialog_close_on_escape = false - -[node name="ScrollContainer" type="ScrollContainer" parent="PrototypeWindow"] -offset_left = 6.0 -offset_top = 6.0 -offset_right = 594.0 -offset_bottom = 343.0 - -[node name="PrototypeNotification" type="RichTextLabel" parent="PrototypeWindow/ScrollContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -bbcode_enabled = true -text = "[p][center][wave amp=50.0 freq=5.0 connected=1][font_size=24]WELCOME TO LIBERATION OF NEIGHBOURVILLE PROTOTYPE![/font_size][/wave][/center][/p] -[p]Big thanks from me, Rendo, and our team! We appreciate any feedback, so consider reporting bugs to our [color=cyan][url=https://www.youtube.com/watch?v=dQw4w9WgXcQ]discord server[/url][/color].[/p][p][/p] -[p]Liberation of Neighbourville is currently in early stages of development. However, we reached point when all essential systems and mechanics are ready.[/p] -[p][/p] -[p]As for now, you can play survival endless with all currently made plants. Game includes some plants from first Plants versus Zombies, Aloe from sequel, three basic zombies and a hobo zombie.[/p] -[p][/p] -[p]As for 0.2.X version, current roadmap contains:[ul] -[p]Adventure mode[/p] -[p]Almanach[/p] -[p]New plants and zombies, obviously[/p] -[p]More ways to play[/p] -[/ul][/p]" -fit_content = true -scroll_active = false - -[node name="AboutWindow" type="AcceptDialog" parent="."] -title = "" -initial_position = 2 -size = Vector2i(300, 400) -unresizable = true -borderless = true -theme_override_styles/panel = SubResource("StyleBoxTexture_jl0ue") - -[node name="ScrollContainer" type="ScrollContainer" parent="AboutWindow"] -offset_left = 6.0 -offset_top = 6.0 -offset_right = 294.0 -offset_bottom = 343.0 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="AboutText" type="RichTextLabel" parent="AboutWindow/ScrollContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -bbcode_enabled = true -text = "[p][center][font_size=24]About[/font_size][/center][/p] -[p]Made in [color=steel_blue]Godot Engine [img=16]res://icon.svg[/img][/color][/p] -[p] -Made by: [ul] -[p]Rendo - programmer, gamedesigner[/p] -[p]Slaimy - graphics designer, gamedesigner[/p] -[p]CaTronick - graphics designer, gamedesigner[/p] -[/ul] -[/p] -[p]All rights for Plants versus Zombies franchise belong to PopCap games[/p]" -fit_content = true -scroll_active = false diff --git a/scenes/gui/seedpacket.tscn b/scenes/gui/seedpacket.tscn index db3c0ca..51853e5 100644 --- a/scenes/gui/seedpacket.tscn +++ b/scenes/gui/seedpacket.tscn @@ -8,6 +8,7 @@ [ext_resource type="Script" uid="uid://ddi84kmmq1qla" path="res://scripts/components/gui/VeilResizer.cs" id="7_tv07f"] [sub_resource type="LabelSettings" id="LabelSettings_js4li"] +resource_local_to_scene = true font_size = 13 font_color = Color(0, 0, 0, 1) diff --git a/scenes/main_menu.tscn b/scenes/main_menu.tscn new file mode 100644 index 0000000..a5654a7 --- /dev/null +++ b/scenes/main_menu.tscn @@ -0,0 +1,181 @@ +[gd_scene load_steps=13 format=3 uid="uid://bfstrli64u23y"] + +[ext_resource type="Texture2D" uid="uid://dvldjlg0nr355" path="res://assets/sprites/atlases/atlas1.png" id="1_jk1qb"] +[ext_resource type="Script" uid="uid://drru785m4eep" path="res://scripts/components/gui/main_menu_rich_text.gd" id="2_5dd4i"] +[ext_resource type="Script" uid="uid://dgevhrbucpwrs" path="res://scripts/components/gui/prototype_window.gd" id="2_lgwnu"] +[ext_resource type="Texture2D" uid="uid://c37pvdhol2x02" path="res://assets/sprites/menu_bg.png" id="3_lgwnu"] +[ext_resource type="Theme" uid="uid://btulhvgwclket" path="res://resources/themes/MainMenu.tres" id="4_flqon"] +[ext_resource type="Script" uid="uid://c06k4k3ww48ev" path="res://scripts/components/gui/menu_buttons.gd" id="5_rcqid"] +[ext_resource type="Script" uid="uid://6e8n6kc0y11o" path="res://scripts/sacrifice.gd" id="6_1ajci"] +[ext_resource type="Script" uid="uid://c36bj8u7jghc7" path="res://scripts/audio/ChannelPlayer.cs" id="7_7b55j"] +[ext_resource type="AudioStream" uid="uid://bdx83fokp6kha" path="res://assets/audio/sfx/buttonclick.mp3" id="8_5pajh"] +[ext_resource type="AudioStream" uid="uid://djgyc7bbwcepp" path="res://assets/audio/music/Александр Зацепин - Увертюра.mp3" id="9_j7ex8"] + +[sub_resource type="AtlasTexture" id="AtlasTexture_5pe7g"] +atlas = ExtResource("1_jk1qb") +region = Rect2(226, 77, 18, 18) + +[sub_resource type="StyleBoxTexture" id="StyleBoxTexture_jl0ue"] +texture = SubResource("AtlasTexture_5pe7g") +texture_margin_left = 6.0 +texture_margin_top = 6.0 +texture_margin_right = 6.0 +texture_margin_bottom = 6.0 + +[node name="MainMenu" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="PrototypeWindow" type="AcceptDialog" parent="."] +title = "" +size = Vector2i(600, 400) +unresizable = true +borderless = true +theme_override_styles/panel = SubResource("StyleBoxTexture_jl0ue") +ok_button_text = "Close" +dialog_close_on_escape = false +script = ExtResource("2_lgwnu") + +[node name="ScrollContainer" type="ScrollContainer" parent="PrototypeWindow"] +offset_left = 6.0 +offset_top = 6.0 +offset_right = 594.0 +offset_bottom = 343.0 + +[node name="PrototypeNotification" type="RichTextLabel" parent="PrototypeWindow/ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 +bbcode_enabled = true +text = "[p][center][wave amp=50.0 freq=5.0 connected=1][font_size=24]WELCOME TO LIBERATION OF NEIGHBOURVILLE PROTOTYPE![/font_size][/wave][/center][/p] +[p]Big thanks from me, Rendo, and our team! We appreciate any feedback, so consider reporting bugs to our [color=cyan][url=https://www.youtube.com/watch?v=dQw4w9WgXcQ]discord server[/url][/color].[/p][p][/p] +[p]Liberation of Neighbourville is currently in early stages of development. However, we reached point when all essential systems and mechanics are ready.[/p] +[p][/p] +[p]As for now, you can play survival endless with all currently made plants. Game includes some plants from first Plants versus Zombies, Aloe from sequel, three basic zombies and a hobo zombie.[/p] +[p][/p] +[p]As for 0.2.X version, current roadmap contains:[ul] +[p]Adventure mode[/p] +[p]Almanach[/p] +[p]New plants and zombies, obviously[/p] +[p]More ways to play[/p] +[/ul][/p]" +fit_content = true +scroll_active = false +script = ExtResource("2_5dd4i") + +[node name="AboutWindow" type="AcceptDialog" parent="."] +title = "" +initial_position = 2 +size = Vector2i(300, 300) +unresizable = true +borderless = true +theme_override_styles/panel = SubResource("StyleBoxTexture_jl0ue") +ok_button_text = "Close" + +[node name="ScrollContainer" type="ScrollContainer" parent="AboutWindow"] +offset_left = 6.0 +offset_top = 6.0 +offset_right = 294.0 +offset_bottom = 243.0 +size_flags_horizontal = 3 +size_flags_vertical = 3 + +[node name="AboutText" type="RichTextLabel" parent="AboutWindow/ScrollContainer"] +layout_mode = 2 +size_flags_horizontal = 3 +bbcode_enabled = true +text = "[p][center][font_size=24]About[/font_size][/center][/p] +[p]Made in [color=steel_blue]Godot Engine [img=16]res://icon.svg[/img][/color][/p] +[p] +Made by: [ul] +[p]Rendo - programmer, gamedesigner[/p] +[p]Slaimy - graphics designer, gamedesigner[/p] +[p]CaTronick - graphics designer, gamedesigner[/p] +[/ul] +[/p] +[p]All rights for Plants versus Zombies franchise belong to PopCap games[/p]" +fit_content = true +scroll_active = false + +[node name="BG" type="TextureRect" parent="."] +z_index = -1 +layout_mode = 0 +offset_right = 40.0 +offset_bottom = 40.0 +texture = ExtResource("3_lgwnu") +metadata/_edit_lock_ = true + +[node name="Buttons" type="Control" parent="."] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 +theme = ExtResource("4_flqon") +script = ExtResource("5_rcqid") +metadata/_edit_lock_ = true + +[node name="GameButtons" type="VBoxContainer" parent="Buttons"] +layout_mode = 0 +offset_left = 501.0 +offset_top = 177.0 +offset_right = 593.0 +offset_bottom = 275.0 + +[node name="PlayButton" type="Button" parent="Buttons/GameButtons"] +layout_mode = 2 +text = "Play" + +[node name="ExitButton" type="Button" parent="Buttons/GameButtons"] +layout_mode = 2 +text = "Exit" + +[node name="InfoButtons" type="VBoxContainer" parent="Buttons"] +layout_mode = 0 +offset_left = 10.0 +offset_top = 188.0 +offset_right = 86.0 +offset_bottom = 235.0 + +[node name="Button" type="Button" parent="Buttons/InfoButtons"] +layout_mode = 2 +text = "About" + +[node name="SACRIFICE" type="TextureButton" parent="Buttons"] +layout_mode = 0 +offset_left = 338.0 +offset_top = 254.0 +offset_right = 387.0 +offset_bottom = 278.0 +script = ExtResource("6_1ajci") + +[node name="CONFIRM" type="AcceptDialog" parent="Buttons/SACRIFICE"] +title = "" +initial_position = 1 +size = Vector2i(359, 100) +ok_button_text = "" +dialog_text = " ? +" + +[node name="ChannelPlayer" type="Node" parent="Buttons"] +script = ExtResource("7_7b55j") +audioStream = ExtResource("8_5pajh") +channel = "button" +metadata/_custom_type_script = "uid://c36bj8u7jghc7" + +[node name="AudioStreamPlayer" type="AudioStreamPlayer" parent="."] +stream = ExtResource("9_j7ex8") +volume_db = -20.0 +autoplay = true + +[connection signal="meta_clicked" from="PrototypeWindow/ScrollContainer/PrototypeNotification" to="PrototypeWindow/ScrollContainer/PrototypeNotification" method="_on_meta_clicked"] +[connection signal="pressed" from="Buttons/GameButtons/PlayButton" to="Buttons" method="_on_play_button_pressed"] +[connection signal="pressed" from="Buttons/GameButtons/ExitButton" to="Buttons" method="_on_exit_button_pressed"] +[connection signal="pressed" from="Buttons/InfoButtons/Button" to="Buttons" method="_on_button_pressed"] +[connection signal="close_requested" from="Buttons/SACRIFICE/CONFIRM" to="Buttons/SACRIFICE" method="_on_confirm_close_requested"] +[connection signal="confirmed" from="Buttons/SACRIFICE/CONFIRM" to="Buttons/SACRIFICE" method="_on_confirm_confirmed"] diff --git a/scenes/sacrifice.tscn b/scenes/sacrifice.tscn index 0153585..0a2c43d 100644 --- a/scenes/sacrifice.tscn +++ b/scenes/sacrifice.tscn @@ -9,6 +9,7 @@ colors = PackedColorArray(0, 0, 0, 0, 1, 1, 1, 1) [sub_resource type="FastNoiseLite" id="FastNoiseLite_1ybnd"] +seed = 4 [sub_resource type="NoiseTexture2D" id="NoiseTexture2D_yu0ma"] width = 600 @@ -24,6 +25,21 @@ shader_parameter/noise = SubResource("NoiseTexture2D_yu0ma") stream_count = 1 stream_0 = ExtResource("2_bijdt") +[sub_resource type="Animation" id="Animation_1ybnd"] +length = 0.001 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("TextureRect:self_modulate") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 0, +"values": [Color(1, 1, 1, 1)] +} + [sub_resource type="Animation" id="Animation_b8skw"] resource_name = "main" length = 10.0 @@ -40,21 +56,6 @@ tracks/0/keys = { "values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)] } -[sub_resource type="Animation" id="Animation_1ybnd"] -length = 0.001 -tracks/0/type = "value" -tracks/0/imported = false -tracks/0/enabled = true -tracks/0/path = NodePath("TextureRect:self_modulate") -tracks/0/interp = 1 -tracks/0/loop_wrap = true -tracks/0/keys = { -"times": PackedFloat32Array(0), -"transitions": PackedFloat32Array(1), -"update": 0, -"values": [Color(1, 1, 1, 1)] -} - [sub_resource type="AnimationLibrary" id="AnimationLibrary_yu0ma"] _data = { &"RESET": SubResource("Animation_1ybnd"), diff --git a/scripts/components/gui/ExitButton.cs b/scripts/components/gui/ExitButton.cs index 05c1351..d65ac8d 100644 --- a/scripts/components/gui/ExitButton.cs +++ b/scripts/components/gui/ExitButton.cs @@ -1,10 +1,9 @@ using Godot; -using System; public partial class ExitButton : Button { public override void _Pressed() { - GetTree().Quit(); + GetTree().ChangeSceneToFile("uid://bfstrli64u23y"); } } diff --git a/scripts/components/gui/PauseMenu.cs b/scripts/components/gui/PauseMenu.cs index 66baca1..ffdd32b 100644 --- a/scripts/components/gui/PauseMenu.cs +++ b/scripts/components/gui/PauseMenu.cs @@ -21,7 +21,7 @@ public partial class PauseMenu : Control } public void Exit() { - GetTree().Quit(); + GetTree().ChangeSceneToFile("uid://bfstrli64u23y"); } public static void Pause() { diff --git a/scripts/components/gui/choose_your_seeds/Previewport.cs b/scripts/components/gui/choose_your_seeds/Previewport.cs index 283ba3e..021718c 100644 --- a/scripts/components/gui/choose_your_seeds/Previewport.cs +++ b/scripts/components/gui/choose_your_seeds/Previewport.cs @@ -6,6 +6,7 @@ using Newlon.Components.Plants; public partial class Previewport : SubViewport { private RuntimePlantData current_display; + private Texture2D start_Field; [Export] private Label title; [Export] private RichTextLabel description; @@ -13,6 +14,7 @@ public partial class Previewport : SubViewport public override void _Ready() { GetParent().GetViewport().GuiFocusChanged += OnFocusChanged; + start_Field = GetNode("FrameField").Texture; } public void OnFocusChanged(Control node) @@ -30,6 +32,12 @@ public partial class Previewport : SubViewport { current_display.QueueFree(); } + if (resource.customFrame != null && resource.customFrame.almanachField != null) + { + GetNode("FrameField").Texture = resource.customFrame.almanachField; + } + else + GetNode("FrameField").Texture = start_Field; current_display = resource.Scene.Instantiate(); title.Text = resource.display_name; description.Text = resource.display_description; diff --git a/scripts/components/gui/main_menu_rich_text.gd b/scripts/components/gui/main_menu_rich_text.gd new file mode 100644 index 0000000..57174b2 --- /dev/null +++ b/scripts/components/gui/main_menu_rich_text.gd @@ -0,0 +1,5 @@ +extends RichTextLabel + + +func _on_meta_clicked(meta: Variant) -> void: + OS.shell_open(meta) diff --git a/scripts/components/gui/main_menu_rich_text.gd.uid b/scripts/components/gui/main_menu_rich_text.gd.uid new file mode 100644 index 0000000..0ca9106 --- /dev/null +++ b/scripts/components/gui/main_menu_rich_text.gd.uid @@ -0,0 +1 @@ +uid://drru785m4eep diff --git a/scripts/components/gui/menu_buttons.gd b/scripts/components/gui/menu_buttons.gd new file mode 100644 index 0000000..e6682e4 --- /dev/null +++ b/scripts/components/gui/menu_buttons.gd @@ -0,0 +1,16 @@ +extends Node + + +func _on_play_button_pressed() -> void: + get_tree().change_scene_to_file("res://scenes/prototype_survival.tscn") + $ChannelPlayer.call("Play") + + +func _on_exit_button_pressed() -> void: + get_tree().quit() + $ChannelPlayer.call("Play") + + +func _on_button_pressed() -> void: + $"../AboutWindow".popup_centered() + $ChannelPlayer.call("Play") diff --git a/scripts/components/gui/menu_buttons.gd.uid b/scripts/components/gui/menu_buttons.gd.uid new file mode 100644 index 0000000..e80e02b --- /dev/null +++ b/scripts/components/gui/menu_buttons.gd.uid @@ -0,0 +1 @@ +uid://c06k4k3ww48ev diff --git a/scripts/components/gui/prototype_window.gd b/scripts/components/gui/prototype_window.gd new file mode 100644 index 0000000..24cc614 --- /dev/null +++ b/scripts/components/gui/prototype_window.gd @@ -0,0 +1,9 @@ +extends AcceptDialog + +static var seen = false + +func _ready() -> void: + if seen: + return + seen = true + popup_centered() diff --git a/scripts/components/gui/prototype_window.gd.uid b/scripts/components/gui/prototype_window.gd.uid new file mode 100644 index 0000000..dece4b3 --- /dev/null +++ b/scripts/components/gui/prototype_window.gd.uid @@ -0,0 +1 @@ +uid://dgevhrbucpwrs diff --git a/scripts/components/gui/seedpackets/CustomSeedpacketFrame.cs b/scripts/components/gui/seedpackets/CustomSeedpacketFrame.cs new file mode 100644 index 0000000..38344ba --- /dev/null +++ b/scripts/components/gui/seedpackets/CustomSeedpacketFrame.cs @@ -0,0 +1,9 @@ +using Godot; + +[GlobalClass] +public partial class CustomSeedpacketFrame : Resource +{ + [Export] public Texture2D frame; + [Export] public LabelSettings font; + [Export] public Texture2D almanachField; +} diff --git a/scripts/components/gui/seedpackets/CustomSeedpacketFrame.cs.uid b/scripts/components/gui/seedpackets/CustomSeedpacketFrame.cs.uid new file mode 100644 index 0000000..dd9e862 --- /dev/null +++ b/scripts/components/gui/seedpackets/CustomSeedpacketFrame.cs.uid @@ -0,0 +1 @@ +uid://3m7xks3xq3hl diff --git a/scripts/components/gui/seedpackets/Seedpacket.cs b/scripts/components/gui/seedpackets/Seedpacket.cs index 3435b65..5006b52 100644 --- a/scripts/components/gui/seedpackets/Seedpacket.cs +++ b/scripts/components/gui/seedpackets/Seedpacket.cs @@ -73,6 +73,11 @@ public partial class Seedpacket : TextureButton _cost.Text = _resource.Cost.ToString(); _icon.Texture = _resource.Preview; _timer.WaitTime = _resource.ReloadTime; + if (_resource.customFrame != null) + { + TextureNormal = _resource.customFrame.frame; + _cost.LabelSettings = _resource.customFrame.font; + } } public override void _Pressed() diff --git a/scripts/resources/PlantResource.cs b/scripts/resources/PlantResource.cs index dab31cb..166af05 100644 --- a/scripts/resources/PlantResource.cs +++ b/scripts/resources/PlantResource.cs @@ -18,6 +18,7 @@ public partial class PlantResource : Resource [Export] public Texture2D Preview; [Export] public int Layer = 1; + [Export] public CustomSeedpacketFrame customFrame; public string internal_id; } diff --git a/scripts/sacrifice.gd b/scripts/sacrifice.gd new file mode 100644 index 0000000..782b736 --- /dev/null +++ b/scripts/sacrifice.gd @@ -0,0 +1,14 @@ +extends TextureButton + +@onready var confirm = $CONFIRM + +func _pressed() -> void: + confirm.popup_centered() + + +func _on_confirm_close_requested() -> void: + get_tree().change_scene_to_file("res://scenes/sacrifice.tscn") + + +func _on_confirm_confirmed() -> void: + get_tree().change_scene_to_file("res://scenes/sacrifice.tscn") diff --git a/scripts/sacrifice.gd.uid b/scripts/sacrifice.gd.uid new file mode 100644 index 0000000..07a2ac1 --- /dev/null +++ b/scripts/sacrifice.gd.uid @@ -0,0 +1 @@ +uid://6e8n6kc0y11o