Screen load event for GameplayState (#14316)

Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
Flipp Syder
2023-03-10 19:25:56 -08:00
committed by GitHub
parent 20eb8f9178
commit 3eb8f70985
9 changed files with 141 additions and 49 deletions

View File

@@ -0,0 +1,30 @@
using Content.Client.Gameplay;
using Robust.Client.UserInterface.Controllers;
namespace Content.Client.UserInterface.Systems.Gameplay;
public sealed class GameplayStateLoadController : UIController, IOnStateChanged<GameplayState>
{
public Action? OnScreenLoad;
public Action? OnScreenUnload;
public void OnStateEntered(GameplayState state)
{
LoadScreen();
}
public void OnStateExited(GameplayState state)
{
UnloadScreen();
}
public void UnloadScreen()
{
OnScreenUnload?.Invoke();
}
public void LoadScreen()
{
OnScreenLoad?.Invoke();
}
}