28 lines
602 B
C#
28 lines
602 B
C#
using Godot;
|
|
using Newlon.Resources;
|
|
|
|
[Tool]
|
|
public partial class ForbiddableSeedpacket : TextureButton
|
|
{
|
|
[Signal] public delegate void SaveCallbackEventHandler();
|
|
[Export] private TextureRect preview;
|
|
[Export] private TextureRect forrbidTexture;
|
|
public PlantResource HeldResource;
|
|
public bool forbidden = false;
|
|
public override void _Pressed()
|
|
{
|
|
forbidden = !forbidden;
|
|
Update();
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
RefreshTexture();
|
|
EmitSignal(SignalName.SaveCallback);
|
|
}
|
|
public void RefreshTexture()
|
|
{
|
|
preview.Texture = HeldResource.Preview;
|
|
forrbidTexture.Visible = forbidden;
|
|
}
|
|
}
|