hurrmmm/godot/UI/TAS UI/AdvanceButton.cs

32 lines
543 B
C#

using Godot;
using System;
public partial class AdvanceButton : Button
{
TAS_System TAS;
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
TAS = GetNode<TAS_System>("/root/TAS_System");
this.Pressed += () => { TAS.Advance(1); };
}
// Called every frame. 'delta' is the elapsed time since the previous frame.
public override void _Process(double delta)
{
if (TAS.AdvancedFramesRemaining == 0)
{
this.Disabled = true;
}
else
{
this.Disabled = false;
}
}
}