Forbidden plants
This commit is contained in:
parent
56f75a5d06
commit
3fe903f2b8
9 changed files with 92 additions and 36 deletions
|
|
@ -0,0 +1,28 @@
|
|||
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;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue