Editor slight refactor

This commit is contained in:
Rendo 2025-07-29 00:53:29 +05:00
commit 8cfbad01cf
23 changed files with 9 additions and 8 deletions

View file

@ -1,29 +0,0 @@
using Godot;
using Newlon.Resources;
[Tool]
public partial class ZE_RowEditor : VBoxContainer
{
private PackedScene buttonScene = ResourceLoader.Load<PackedScene>("uid://segxys6udhyw");
[Signal] public delegate void SaveCallbackEventHandler();
public RowSpawn editedSpawn;
public override void _Ready()
{
for (int i = 0; i < editedSpawn.zombies.Count; i++)
{
var button = buttonScene.Instantiate<ZE_GridItem>();
AddChild(button);
button.index = i;
if (editedSpawn.zombies[i] != null)
button.SetData(editedSpawn.zombies[i]);
button.ResourceChanged += OnResourceChanged;
}
}
public void OnResourceChanged(ZombieResource resource, int index)
{
editedSpawn.zombies[index] = resource;
EmitSignal(SignalName.SaveCallback);
}
}