diff --git a/addons/pvzadventure/WaveData.cs b/addons/pvzadventure/WaveData.cs index 622fafa..d74b191 100644 --- a/addons/pvzadventure/WaveData.cs +++ b/addons/pvzadventure/WaveData.cs @@ -8,4 +8,5 @@ public partial class WaveData : Resource [Export] public Array zombiesOrdered = new(); [Export] public Array events = new(); [Export] public float customWaveDelay = 0; + [Export] public bool isHugeWave; } diff --git a/addons/pvzadventure/scripts/AdventureResourceInspector.cs b/addons/pvzadventure/scripts/AdventureResourceInspector.cs index f6db215..83c006c 100644 --- a/addons/pvzadventure/scripts/AdventureResourceInspector.cs +++ b/addons/pvzadventure/scripts/AdventureResourceInspector.cs @@ -33,11 +33,12 @@ public partial class AdventureResourceInspector : Node private void RefreshTree() { + EmitSignal(SignalName.Refreshed); + tree.Clear(); root = tree.CreateItem(); root.DisableFolding = true; root.SetText(0, "Level"); - EmitSignal(SignalName.Refreshed); var initial = tree.CreateItem(root); initial.SetText(0, "Initial data"); @@ -55,6 +56,12 @@ public partial class AdventureResourceInspector : Node var spawns = tree.CreateItem(item); spawns.SetText(0, "Events"); + var huge_wave = tree.CreateItem(item); + huge_wave.SetCellMode(0, TreeItem.TreeCellMode.Check); + huge_wave.SetChecked(0, heldResource.waves[i].isHugeWave); + huge_wave.SetText(0, "Is huge wave?"); + huge_wave.SetEditable(0, true); + var delay = tree.CreateItem(item); if (heldResource.waves[i].customWaveDelay > 0) delay.SetText(0, heldResource.waves[i].customWaveDelay.ToString(new CultureInfo("en-US"))); @@ -113,15 +120,25 @@ public partial class AdventureResourceInspector : Node public void OnItemEdited() { var selected = tree.GetEdited(); - if (float.TryParse(selected.GetText(0), new CultureInfo("en-US"), out float result)) + + if (selected.GetCellMode(0) == TreeItem.TreeCellMode.Check) { - heldResource.waves[GetWaveIndex(selected.GetParent())].customWaveDelay = result; + heldResource.waves[GetWaveIndex(selected.GetParent())].isHugeWave = selected.IsChecked(0); } else { - selected.SetText(0, "Delay"); - heldResource.waves[GetWaveIndex(selected.GetParent())].customWaveDelay = 0; + if (float.TryParse(selected.GetText(0), new CultureInfo("en-US"), out float result)) + { + heldResource.waves[GetWaveIndex(selected.GetParent())].customWaveDelay = result; + } + else + { + selected.SetText(0, "Delay"); + heldResource.waves[GetWaveIndex(selected.GetParent())].customWaveDelay = 0; + } } + Callable.From(RefreshTree).CallDeferred(); + } public void OnTreeButtonClicked(TreeItem item, int column, int id, int button_index) { diff --git a/project.godot b/project.godot index 552c3de..23294a5 100644 --- a/project.godot +++ b/project.godot @@ -16,7 +16,7 @@ warnings/check_angle_interpolation_type_conflicting=false [application] config/name="Liberation of the Neighbourville" -config/version="0.2.5" +config/version="0.3.0" run/main_scene="uid://bfstrli64u23y" config/features=PackedStringArray("4.4", "C#", "Forward Plus") config/icon="res://icon.png" diff --git a/resources/levels/test_level_for_execution.tres b/resources/levels/test_level_for_execution.tres index 8cf8ae6..6c20113 100644 --- a/resources/levels/test_level_for_execution.tres +++ b/resources/levels/test_level_for_execution.tres @@ -12,13 +12,14 @@ [sub_resource type="Resource" id="Resource_yvl2y"] script = ExtResource("4_8miqm") -zombies = Array[ExtResource("5_8miqm")]([null, null, ExtResource("6_s62qb"), null, null]) +zombies = Array[ExtResource("5_8miqm")]([ExtResource("8_ulhin"), null, ExtResource("6_s62qb"), null, null]) [sub_resource type="Resource" id="Resource_s62qb"] script = ExtResource("3_hlq35") zombiesOrdered = Array[ExtResource("4_8miqm")]([SubResource("Resource_yvl2y")]) events = Array[ExtResource("2_8aewt")]([]) -customWaveDelay = 0.0 +customWaveDelay = 1.0 +isHugeWave = false [sub_resource type="Resource" id="Resource_cafd0"] script = ExtResource("4_8miqm") @@ -33,6 +34,7 @@ script = ExtResource("3_hlq35") zombiesOrdered = Array[ExtResource("4_8miqm")]([SubResource("Resource_cafd0"), SubResource("Resource_y8rkm")]) events = Array[ExtResource("2_8aewt")]([]) customWaveDelay = 0.0 +isHugeWave = true [sub_resource type="Resource" id="Resource_n6yt3"] script = ExtResource("4_8miqm") @@ -47,6 +49,7 @@ script = ExtResource("3_hlq35") zombiesOrdered = Array[ExtResource("4_8miqm")]([SubResource("Resource_n6yt3"), SubResource("Resource_8h2xm")]) events = Array[ExtResource("2_8aewt")]([]) customWaveDelay = 0.0 +isHugeWave = true [resource] script = ExtResource("1_qb1ge") diff --git a/scenes/templates/standard_players_house.tscn b/scenes/templates/standard_players_house.tscn index 9a97757..52a9e35 100644 --- a/scenes/templates/standard_players_house.tscn +++ b/scenes/templates/standard_players_house.tscn @@ -237,9 +237,6 @@ shortcut_keys_enabled = false horizontal_alignment = 1 vertical_alignment = 1 -[node name="GameOverScreen" parent="." index="9"] -visible = false - [node name="CollisionShape2D" parent="GameOverZombie/LoseZone/Hitbox" index="0"] shape = SubResource("WorldBoundaryShape2D_vbgdr") @@ -260,7 +257,7 @@ waveTimer = NodePath("WaveTimer") one_shot = true [node name="Checkbox" parent="." index="16" node_paths=PackedStringArray("gameOverLayer", "fadeAnimation")] -gameOverLayer = NodePath("../GameOverScreen") +gameOverLayer = NodePath("../GameOverZombie") fadeAnimation = NodePath("../GameOverScreen/AnimationPlayer") [node name="CollisionShape2D" parent="Checkbox" index="0"]