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

28 lines
538 B
C#
Raw Normal View History

2023-11-11 15:47:37 -07:00
using Godot;
using System;
public partial class AdvanceButton : Button
{
TAS_System TAS;
2023-11-11 15:47:37 -07:00
// Called when the node enters the scene tree for the first time.
public override void _Ready()
{
TAS = GetNode<TAS_System>("/root/TAS_System");
2023-11-11 15:47:37 -07:00
this.Pressed += () => { TAS.Advance(1); };
2023-11-11 15:47:37 -07:00
}
// 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;
}
2023-11-11 15:47:37 -07:00
}
}