diff --git a/.vscode/settings.json b/.vscode/settings.json index f44eb88..e6f77e8 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "godotTools.editorPath.godot4": "c:\\Users\\User\\Desktop\\Godot_v4.4.1-stable_mono_win64\\Godot_v4.4.1-stable_mono_win64.exe" + "godotTools.editorPath.godot4": "c:\\Program Files\\Godot\\Godot_v4.4.1-stable_mono_win64.exe" } \ No newline at end of file diff --git a/NewLON.csproj.old b/NewLON.csproj.old deleted file mode 100644 index 53cc1f1..0000000 --- a/NewLON.csproj.old +++ /dev/null @@ -1,8 +0,0 @@ - - - net6.0 - net7.0 - net8.0 - true - - \ No newline at end of file diff --git a/addons/pvzadventure/AdventureLevelResource.cs b/addons/pvzadventure/AdventureLevelResource.cs index 46e05a4..0595988 100644 --- a/addons/pvzadventure/AdventureLevelResource.cs +++ b/addons/pvzadventure/AdventureLevelResource.cs @@ -7,5 +7,6 @@ public partial class AdventureLevelResource : Resource { [Export] public float startSun; //[Export] public Array conditions; + [Export(PropertyHint.Range,"0,1,0.01")] public float wavePercentage; [Export] public Array waves; } diff --git a/addons/pvzadventure/FieldSpawn.cs b/addons/pvzadventure/FieldSpawn.cs deleted file mode 100644 index a14532c..0000000 --- a/addons/pvzadventure/FieldSpawn.cs +++ /dev/null @@ -1,8 +0,0 @@ -using Godot; -using System; - -public partial class FieldSpawn : Resource -{ - [Export] public SpawnInfo info; - [Export] public Vector2 position; -} diff --git a/addons/pvzadventure/FieldSpawn.cs.uid b/addons/pvzadventure/FieldSpawn.cs.uid deleted file mode 100644 index 5e32553..0000000 --- a/addons/pvzadventure/FieldSpawn.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://gbeuv0b1mvd7 diff --git a/addons/pvzadventure/GroupSpawn.cs b/addons/pvzadventure/GroupSpawn.cs deleted file mode 100644 index 72498b8..0000000 --- a/addons/pvzadventure/GroupSpawn.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Godot; - -public partial class GroupSpawn : Resource -{ - [Export] public PackedScene packedScene; - [Export] public int amount; -} diff --git a/addons/pvzadventure/GroupSpawn.cs.uid b/addons/pvzadventure/GroupSpawn.cs.uid deleted file mode 100644 index f016205..0000000 --- a/addons/pvzadventure/GroupSpawn.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://b604mrxpt0owi diff --git a/addons/pvzadventure/RowSpawn.cs b/addons/pvzadventure/RowSpawn.cs index 1dedd93..5985e40 100644 --- a/addons/pvzadventure/RowSpawn.cs +++ b/addons/pvzadventure/RowSpawn.cs @@ -1,12 +1,5 @@ using Godot; -[Tool] public partial class RowSpawn : Resource { - [Export] public SpawnInfo zombie1; - [Export] public SpawnInfo zombie2; - [Export] public SpawnInfo zombie3; - [Export] public SpawnInfo zombie4; - [Export] public SpawnInfo zombie5; - } diff --git a/addons/pvzadventure/RowSpawn.cs.uid b/addons/pvzadventure/RowSpawn.cs.uid index 8e41a18..7bba64b 100644 --- a/addons/pvzadventure/RowSpawn.cs.uid +++ b/addons/pvzadventure/RowSpawn.cs.uid @@ -1 +1 @@ -uid://comcftlx0eey2 +uid://dl12rj75tk2qi diff --git a/addons/pvzadventure/SpawnInfo.cs b/addons/pvzadventure/SpawnInfo.cs deleted file mode 100644 index ba2d5ba..0000000 --- a/addons/pvzadventure/SpawnInfo.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Godot; - -public partial class SpawnInfo : Resource -{ - [Export] - public PackedScene scene; -} diff --git a/addons/pvzadventure/SpawnInfo.cs.uid b/addons/pvzadventure/SpawnInfo.cs.uid deleted file mode 100644 index ac790ba..0000000 --- a/addons/pvzadventure/SpawnInfo.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://rnnlkqtm6nhy diff --git a/addons/pvzadventure/WaveData.cs b/addons/pvzadventure/WaveData.cs index 64ff8e2..5c52164 100644 --- a/addons/pvzadventure/WaveData.cs +++ b/addons/pvzadventure/WaveData.cs @@ -5,7 +5,6 @@ using Godot.Collections; [Tool] public partial class WaveData : Resource { - [Export] private Array zombiesDisordered; [Export] private Array zombiesOrdered; - [Export] private Array spawns; + [Export] private Array spawns; } diff --git a/addons/pvzadventure/WaveEvent.cs b/addons/pvzadventure/WaveEvent.cs new file mode 100644 index 0000000..fc628b9 --- /dev/null +++ b/addons/pvzadventure/WaveEvent.cs @@ -0,0 +1,5 @@ +using Godot; + +public partial class WaveEvent : Resource +{ +} diff --git a/addons/pvzadventure/WaveEvent.cs.uid b/addons/pvzadventure/WaveEvent.cs.uid new file mode 100644 index 0000000..037dba1 --- /dev/null +++ b/addons/pvzadventure/WaveEvent.cs.uid @@ -0,0 +1 @@ +uid://cw7yc3i2lgcja diff --git a/addons/pvzadventure/scenes/adventure_editor.tscn b/addons/pvzadventure/scenes/adventure_editor.tscn index 6802855..8f15747 100644 --- a/addons/pvzadventure/scenes/adventure_editor.tscn +++ b/addons/pvzadventure/scenes/adventure_editor.tscn @@ -1,8 +1,7 @@ -[gd_scene load_steps=5 format=3 uid="uid://dkq82o31vr3i2"] +[gd_scene load_steps=4 format=3 uid="uid://dkq82o31vr3i2"] [ext_resource type="Script" uid="uid://dkgxtig5fwdgi" path="res://addons/pvzadventure/scripts/AdventureEditor.cs" id="1_go5yu"] [ext_resource type="Script" uid="uid://binuuattefn7d" path="res://addons/pvzadventure/scripts/FileButton.cs" id="2_d5hwn"] -[ext_resource type="PackedScene" uid="uid://dbiv5n3asc848" path="res://addons/pvzadventure/scenes/disordered_editor.tscn" id="3_1ojhm"] [ext_resource type="Script" uid="uid://b0hl4ap18wbb2" path="res://addons/pvzadventure/scripts/AdventureResourceInspector.cs" id="3_d5hwn"] [node name="AdventureEditor" type="MarginContainer"] @@ -11,6 +10,8 @@ anchor_right = 1.0 anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 +size_flags_horizontal = 3 +size_flags_vertical = 3 theme_override_constants/margin_left = 5 theme_override_constants/margin_top = 5 theme_override_constants/margin_right = 5 @@ -49,16 +50,9 @@ split_offset = 500 [node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/WorkArea"] layout_mode = 2 -[node name="DisorderedEditor" parent="VBoxContainer/WorkArea/PanelContainer" instance=ExtResource("3_1ojhm")] -layout_mode = 2 - [node name="Inspector" type="VSplitContainer" parent="VBoxContainer/WorkArea"] layout_mode = 2 -[node name="Cellinspector" type="MarginContainer" parent="VBoxContainer/WorkArea/Inspector"] -layout_mode = 2 -size_flags_vertical = 3 - [node name="ResourceInspector" type="VBoxContainer" parent="VBoxContainer/WorkArea/Inspector"] layout_mode = 2 size_flags_vertical = 3 @@ -70,7 +64,6 @@ layout_mode = 2 size_flags_vertical = 3 hide_folding = true enable_recursive_folding = false -hide_root = true [node name="ControlButtons" type="HBoxContainer" parent="VBoxContainer/WorkArea/Inspector/ResourceInspector"] layout_mode = 2 diff --git a/addons/pvzadventure/scenes/disordered_editor.tscn b/addons/pvzadventure/scenes/disordered_editor.tscn deleted file mode 100644 index 409f6b8..0000000 --- a/addons/pvzadventure/scenes/disordered_editor.tscn +++ /dev/null @@ -1,43 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://dbiv5n3asc848"] - -[ext_resource type="Script" uid="uid://dvwbkbsccrnri" path="res://addons/pvzadventure/scripts/DisorderedEditor.cs" id="1_55p46"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_c8vty"] -content_margin_left = 20.0 -bg_color = Color(0.351173, 0.700939, 0, 1) -border_width_left = 5 -border_width_top = 5 -border_width_right = 5 -border_width_bottom = 5 -border_color = Color(0.216217, 0.607245, 9.62615e-07, 1) -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 - -[node name="DisorderedEditor" type="ScrollContainer"] -anchors_preset = 15 -anchor_right = 1.0 -anchor_bottom = 1.0 -grow_horizontal = 2 -grow_vertical = 2 -vertical_scroll_mode = 0 -script = ExtResource("1_55p46") - -[node name="MarginContainer" type="MarginContainer" parent="."] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 -theme_override_constants/margin_left = 0 -theme_override_constants/margin_top = 0 -theme_override_constants/margin_right = 0 -theme_override_constants/margin_bottom = 200 - -[node name="HBoxContainer" type="HBoxContainer" parent="MarginContainer"] -layout_mode = 2 -size_flags_horizontal = 3 -size_flags_vertical = 3 - -[node name="AddButton" type="Button" parent="MarginContainer/HBoxContainer"] -layout_mode = 2 -theme_override_styles/normal = SubResource("StyleBoxFlat_c8vty") diff --git a/addons/pvzadventure/scenes/dn_d_card.tscn b/addons/pvzadventure/scenes/dn_d_card.tscn deleted file mode 100644 index 2dd6334..0000000 --- a/addons/pvzadventure/scenes/dn_d_card.tscn +++ /dev/null @@ -1,45 +0,0 @@ -[gd_scene load_steps=4 format=3 uid="uid://dcxxgs78o2apq"] - -[ext_resource type="Script" uid="uid://c2wsvwbqpay8p" path="res://addons/pvzadventure/scripts/DnDCard.cs" id="1_k1qq1"] - -[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_t7e3j"] -bg_color = Color(0.136826, 0.136826, 0.136826, 1) -border_width_left = 5 -border_width_top = 5 -border_width_right = 5 -border_width_bottom = 5 -border_color = Color(0.099986, 0.099986, 0.0999859, 1) -border_blend = true -corner_radius_top_left = 5 -corner_radius_top_right = 5 -corner_radius_bottom_right = 5 -corner_radius_bottom_left = 5 - -[sub_resource type="ViewportTexture" id="ViewportTexture_k1qq1"] -viewport_path = NodePath("SubViewport") - -[node name="DnDCard" type="PanelContainer"] -custom_minimum_size = Vector2(60, 80) -anchors_preset = -1 -anchor_right = 0.098 -anchor_bottom = 0.172 -offset_right = 1.2 -offset_bottom = 11.2 -theme_override_styles/panel = SubResource("StyleBoxFlat_t7e3j") -script = ExtResource("1_k1qq1") - -[node name="TextureRect" type="TextureRect" parent="."] -layout_mode = 2 -mouse_filter = 2 -texture = SubResource("ViewportTexture_k1qq1") -expand_mode = 4 -stretch_mode = 5 - -[node name="SubViewport" type="SubViewport" parent="."] -transparent_bg = true -canvas_item_default_texture_filter = 0 -size = Vector2i(50, 70) - -[node name="Camera2D" type="Camera2D" parent="SubViewport"] -position = Vector2(0, -40) -zoom = Vector2(0.6, 0.6) diff --git a/addons/pvzadventure/scenes/dn_d_with_number.tscn b/addons/pvzadventure/scenes/dn_d_with_number.tscn deleted file mode 100644 index c57a7e3..0000000 --- a/addons/pvzadventure/scenes/dn_d_with_number.tscn +++ /dev/null @@ -1,23 +0,0 @@ -[gd_scene load_steps=3 format=3 uid="uid://bcswnjdptjuuf"] - -[ext_resource type="PackedScene" uid="uid://dcxxgs78o2apq" path="res://addons/pvzadventure/scenes/dn_d_card.tscn" id="1_7k686"] -[ext_resource type="Script" uid="uid://da8tobx0q5ij3" path="res://addons/pvzadventure/scripts/DnDWithNumber.cs" id="1_dkrus"] - -[node name="DnDWithNumber" type="VBoxContainer"] -offset_right = 40.0 -offset_bottom = 40.0 -script = ExtResource("1_dkrus") - -[node name="DnDCard" parent="." instance=ExtResource("1_7k686")] -layout_mode = 2 -size_flags_vertical = 3 - -[node name="SpinBox" type="SpinBox" parent="."] -layout_mode = 2 -size_flags_vertical = 8 -min_value = 1.0 -value = 1.0 -allow_greater = true - -[connection signal="DnDDropped" from="DnDCard" to="." method="OnCardDropped"] -[connection signal="value_changed" from="SpinBox" to="." method="OnNumberSubmitted"] diff --git a/addons/pvzadventure/scenes/zombie_editor.tscn b/addons/pvzadventure/scenes/zombie_editor.tscn new file mode 100644 index 0000000..3dc491f --- /dev/null +++ b/addons/pvzadventure/scenes/zombie_editor.tscn @@ -0,0 +1,9 @@ +[gd_scene format=3 uid="uid://db5ah76l43ng2"] + +[node name="ZombieEditor" type="Control"] +layout_mode = 3 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 diff --git a/addons/pvzadventure/scripts/AdventureResourceInspector.cs b/addons/pvzadventure/scripts/AdventureResourceInspector.cs index 6e9a826..8e00e31 100644 --- a/addons/pvzadventure/scripts/AdventureResourceInspector.cs +++ b/addons/pvzadventure/scripts/AdventureResourceInspector.cs @@ -4,9 +4,8 @@ using System; [Tool] public partial class AdventureResourceInspector : Node { - const int DISORDERED = 0; - const int ORDERED = 1; - const int SPAWNS = 2; + const int ORDERED = 0; + const int EVENTS = 1; private Tree tree; private AdventureLevelResource heldResource; @@ -31,6 +30,7 @@ public partial class AdventureResourceInspector : Node tree.Clear(); root = tree.CreateItem(); root.DisableFolding = true; + root.SetText(0, "Level"); EmitSignal(SignalName.Refreshed); for (int i = 0; i < heldResource.waves.Count; i++) @@ -40,14 +40,11 @@ public partial class AdventureResourceInspector : Node item.SetText(0, string.Format("Wave {0}", i)); item.AddButton(0, deleteTexture, tooltipText: "Removes wave. (note that number will not visibly change)"); - var disorder = tree.CreateItem(item); - disorder.SetText(0, "Disordered zombies"); - var order = tree.CreateItem(item); - order.SetText(0, "Ordered zombies"); + order.SetText(0, "Zombies"); var spawns = tree.CreateItem(item); - spawns.SetText(0, "Field spawns"); + spawns.SetText(0, "Events"); } } @@ -61,20 +58,24 @@ public partial class AdventureResourceInspector : Node public void OnItemSelected() { var selected = tree.GetSelected(); - if (selected.GetParent() == root) return; - - var index = selected.GetIndex(); - if (index == DISORDERED) + if (selected == root) { + GD.Print("level pressed"); } - else if (index == ORDERED) - { - - } - else if (index == SPAWNS) + else { + if (selected.GetParent() == root) return; + var index = selected.GetIndex(); + if (index == ORDERED) + { + GD.Print("Zombies pressed"); + } + else if (index == EVENTS) + { + GD.Print("Events pressed"); + } } } diff --git a/addons/pvzadventure/scripts/DisorderedEditor.cs b/addons/pvzadventure/scripts/DisorderedEditor.cs deleted file mode 100644 index 40d6cb7..0000000 --- a/addons/pvzadventure/scripts/DisorderedEditor.cs +++ /dev/null @@ -1,7 +0,0 @@ -using Godot; - -[Tool] -public partial class DisorderedEditor : ScrollContainer -{ - public WaveData editedWave; -} diff --git a/addons/pvzadventure/scripts/DisorderedEditor.cs.uid b/addons/pvzadventure/scripts/DisorderedEditor.cs.uid deleted file mode 100644 index fc2e3dc..0000000 --- a/addons/pvzadventure/scripts/DisorderedEditor.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://dvwbkbsccrnri diff --git a/addons/pvzadventure/scripts/DnDCard.cs b/addons/pvzadventure/scripts/DnDCard.cs deleted file mode 100644 index e6c7070..0000000 --- a/addons/pvzadventure/scripts/DnDCard.cs +++ /dev/null @@ -1,37 +0,0 @@ -using Godot; -using Godot.Collections; - -[Tool] -public partial class DnDCard : PanelContainer -{ - private Variant tempData; - private PackedScene packedScene; - private Node instantiated; - - [Signal] public delegate void DnDDroppedEventHandler(PackedScene scene); - - public override void _Notification(int what) - { - if (what == NotificationDragBegin) - { - tempData = GetViewport().GuiGetDragData(); - } - else if (what == NotificationDragEnd && GetGlobalRect().HasPoint(GetGlobalMousePosition())) - { - var loaded = ResourceLoader.Load(tempData.AsGodotDictionary()["files"].AsStringArray()[0]); - if (loaded is PackedScene scene) - { - packedScene = scene; - EmitSignal(SignalName.DnDDropped, packedScene); - } - } - } - private void Refresh() - { - if (instantiated != null) instantiated.QueueFree(); - instantiated = packedScene.Instantiate(); - GetNode("SubViewport").AddChild(instantiated); - } - - -} diff --git a/addons/pvzadventure/scripts/DnDCard.cs.uid b/addons/pvzadventure/scripts/DnDCard.cs.uid deleted file mode 100644 index e102243..0000000 --- a/addons/pvzadventure/scripts/DnDCard.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://c2wsvwbqpay8p diff --git a/addons/pvzadventure/scripts/DnDWithNumber.cs b/addons/pvzadventure/scripts/DnDWithNumber.cs deleted file mode 100644 index 8a16c90..0000000 --- a/addons/pvzadventure/scripts/DnDWithNumber.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Godot; - -[Tool] -public partial class DnDWithNumber : VBoxContainer -{ - [Signal] public delegate void DnDChangedEventHandler(PackedScene scene, int number); - private PackedScene packedScene; - private int number; - - public void OnCardDropped(PackedScene scene) - { - packedScene = scene; - SendSignal(); - } - - public void OnNumberSubmitted(float value) - { - number = (int)value; - SendSignal(); - } - - public void SendSignal() - { - EmitSignal(SignalName.DnDChanged, packedScene, number); - } -} diff --git a/addons/pvzadventure/scripts/DnDWithNumber.cs.uid b/addons/pvzadventure/scripts/DnDWithNumber.cs.uid deleted file mode 100644 index 43e2f36..0000000 --- a/addons/pvzadventure/scripts/DnDWithNumber.cs.uid +++ /dev/null @@ -1 +0,0 @@ -uid://da8tobx0q5ij3 diff --git a/resources/levels/testlvl.tres b/resources/levels/testlvl.tres index 7520364..8dd9f07 100644 --- a/resources/levels/testlvl.tres +++ b/resources/levels/testlvl.tres @@ -1,17 +1,40 @@ -[gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=4 format=3 uid="uid://bx1wnrgickeyd"] +[gd_resource type="Resource" script_class="AdventureLevelResource" load_steps=9 format=3 uid="uid://bx1wnrgickeyd"] [ext_resource type="Script" uid="uid://bximdujbkj2n4" path="res://addons/pvzadventure/AdventureLevelResource.cs" id="1_ed2ji"] [ext_resource type="Script" uid="uid://7rptlb5qr3b6" path="res://addons/pvzadventure/WaveData.cs" id="2_46l53"] [sub_resource type="Resource" id="Resource_46l53"] script = ExtResource("2_46l53") -zombiesDisordered = [null] -zombiesOrdered = [null] -spawns = [null] -metadata/_custom_type_script = "uid://7rptlb5qr3b6" +zombiesOrdered = null +spawns = null + +[sub_resource type="Resource" id="Resource_yo1i5"] +script = ExtResource("2_46l53") +zombiesOrdered = null +spawns = null + +[sub_resource type="Resource" id="Resource_xqi0a"] +script = ExtResource("2_46l53") +zombiesOrdered = null +spawns = null + +[sub_resource type="Resource" id="Resource_ak572"] +script = ExtResource("2_46l53") +zombiesOrdered = null +spawns = null + +[sub_resource type="Resource" id="Resource_vfl7c"] +script = ExtResource("2_46l53") +zombiesOrdered = null +spawns = null + +[sub_resource type="Resource" id="Resource_pdnxq"] +script = ExtResource("2_46l53") +zombiesOrdered = null +spawns = null [resource] script = ExtResource("1_ed2ji") startSun = 0.0 -waves = [SubResource("Resource_46l53")] +waves = [SubResource("Resource_46l53"), SubResource("Resource_yo1i5"), SubResource("Resource_xqi0a"), SubResource("Resource_ak572"), SubResource("Resource_vfl7c"), SubResource("Resource_pdnxq")] metadata/_custom_type_script = "uid://bximdujbkj2n4" diff --git a/translations/gui.en.translation b/translations/gui.en.translation index 851aaed..7e035f7 100644 Binary files a/translations/gui.en.translation and b/translations/gui.en.translation differ diff --git a/translations/gui.ru.translation b/translations/gui.ru.translation index 856368c..da4e7af 100644 Binary files a/translations/gui.ru.translation and b/translations/gui.ru.translation differ diff --git a/translations/plants.en.translation b/translations/plants.en.translation index d431b30..fdff9b2 100644 Binary files a/translations/plants.en.translation and b/translations/plants.en.translation differ diff --git a/translations/plants.ru.translation b/translations/plants.ru.translation index dc540f9..228d448 100644 Binary files a/translations/plants.ru.translation and b/translations/plants.ru.translation differ diff --git a/translations/zombies.en.translation b/translations/zombies.en.translation index 88a3679..e020dc1 100644 Binary files a/translations/zombies.en.translation and b/translations/zombies.en.translation differ diff --git a/translations/zombies.ru.translation b/translations/zombies.ru.translation index 3598bc4..15340f2 100644 Binary files a/translations/zombies.ru.translation and b/translations/zombies.ru.translation differ