Huge wave flag

This commit is contained in:
Rendo 2025-07-16 21:55:47 +05:00
commit 19e16c62d7
5 changed files with 30 additions and 12 deletions

View file

@ -8,4 +8,5 @@ public partial class WaveData : Resource
[Export] public Array<RowSpawn> zombiesOrdered = new();
[Export] public Array<WaveEvent> events = new();
[Export] public float customWaveDelay = 0;
[Export] public bool isHugeWave;
}

View file

@ -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)
{

View file

@ -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"

View file

@ -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")

View file

@ -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"]