Screen load event for GameplayState (#14316)
Co-authored-by: metalgearsloth <comedian_vs_clown@hotmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
using Content.Client.Alerts;
|
||||
using Content.Client.Gameplay;
|
||||
using Content.Client.UserInterface.Systems.Alerts.Widgets;
|
||||
using Content.Client.UserInterface.Systems.Gameplay;
|
||||
using Content.Shared.Alert;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Client.UserInterface.Controllers;
|
||||
@@ -13,6 +14,19 @@ public sealed class AlertsUIController : UIController, IOnStateEntered<GameplayS
|
||||
|
||||
private AlertsUI? UI => UIManager.GetActiveUIWidgetOrNull<AlertsUI>();
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
|
||||
var gameplayStateLoad = UIManager.GetUIController<GameplayStateLoadController>();
|
||||
gameplayStateLoad.OnScreenLoad += OnScreenLoad;
|
||||
}
|
||||
|
||||
private void OnScreenLoad()
|
||||
{
|
||||
SyncAlerts();
|
||||
}
|
||||
|
||||
private void OnAlertPressed(object? sender, AlertType e)
|
||||
{
|
||||
_alertsSystem?.AlertClicked(e);
|
||||
|
||||
Reference in New Issue
Block a user