Overhaul
This commit is contained in:
@@ -7,6 +7,28 @@ public partial class LoadingScreen : Control
|
||||
{
|
||||
public override void _Notification(int what) => this.Notify(what);
|
||||
|
||||
[Node]
|
||||
public ProgressBar ProgressBar { get; set; } = default!;
|
||||
[Node] public ProgressBar ProgressBar { get; set; } = default!;
|
||||
|
||||
[Node] public AnimationPlayer AnimationPlayer { get; set; } = default!;
|
||||
|
||||
public void OnResolved()
|
||||
{
|
||||
AnimationPlayer.AnimationFinished += AnimationPlayer_AnimationFinished;
|
||||
}
|
||||
|
||||
private void AnimationPlayer_AnimationFinished(StringName animName)
|
||||
{
|
||||
if (animName == "fade_out")
|
||||
Hide();
|
||||
}
|
||||
|
||||
public void ShowLoadingScreen()
|
||||
{
|
||||
Show();
|
||||
}
|
||||
|
||||
public void HideLoadingScreen()
|
||||
{
|
||||
AnimationPlayer.Play("fade_out");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user