Zombie editor

This commit is contained in:
Rendo 2025-07-16 04:11:26 +05:00
commit 7d1ca26baa
23 changed files with 435 additions and 25 deletions

View file

@ -6,6 +6,7 @@ public partial class AdventureResourceInspector : Node
{
const int ORDERED = 0;
const int EVENTS = 1;
private PackedScene zombieEditorScene = ResourceLoader.Load<PackedScene>("uid://db5ah76l43ng2");
private Tree tree;
private AdventureLevelResource heldResource;
@ -14,6 +15,10 @@ public partial class AdventureResourceInspector : Node
[Signal]
public delegate void RefreshedEventHandler();
[Export]
public Control editorContainer;
public override void _Ready()
{
tree = GetNode<Tree>("Tree");
@ -57,6 +62,11 @@ public partial class AdventureResourceInspector : Node
public void OnItemSelected()
{
foreach (var child in editorContainer.GetChildren())
{
child.QueueFree();
}
var selected = tree.GetSelected();
if (selected == root)
{
@ -70,7 +80,10 @@ public partial class AdventureResourceInspector : Node
var index = selected.GetIndex();
if (index == ORDERED)
{
GD.Print("Zombies pressed");
var editor = zombieEditorScene.Instantiate<ZombieEditor>();
editorContainer.AddChild(editor);
editor.SetEditedWave(heldResource.waves[int.Parse(selected.GetParent().GetText(0).Split(" ")[1])]);
}
else if (index == EVENTS)
{