Editor slight refactor
This commit is contained in:
parent
285b90f503
commit
8cfbad01cf
23 changed files with 9 additions and 8 deletions
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue