2022-01-05 00:19:23 -08:00
|
|
|
using Robust.Shared.GameStates;
|
2024-11-09 01:28:24 +01:00
|
|
|
using Robust.Shared.Serialization;
|
2022-01-05 00:19:23 -08:00
|
|
|
|
|
|
|
|
namespace Content.Shared.Alert;
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Handles the icons on the right side of the screen.
|
|
|
|
|
/// Should only be used for player-controlled entities.
|
|
|
|
|
/// </summary>
|
2024-11-09 01:28:24 +01:00
|
|
|
// Component is not AutoNetworked due to supporting clientside-only alerts.
|
|
|
|
|
// Component state is handled manually to avoid the server overwriting the client list.
|
|
|
|
|
[RegisterComponent, NetworkedComponent]
|
2023-08-22 18:14:33 -07:00
|
|
|
public sealed partial class AlertsComponent : Component
|
2022-01-05 00:19:23 -08:00
|
|
|
{
|
2023-09-28 16:20:29 -07:00
|
|
|
[ViewVariables]
|
|
|
|
|
public Dictionary<AlertKey, AlertState> Alerts = new();
|
2022-09-14 21:40:05 +12:00
|
|
|
|
|
|
|
|
public override bool SendOnlyToOwner => true;
|
2022-01-05 00:19:23 -08:00
|
|
|
}
|
2024-11-09 01:28:24 +01:00
|
|
|
|
|
|
|
|
[Serializable, NetSerializable]
|
|
|
|
|
public sealed class AlertComponentState : ComponentState
|
|
|
|
|
{
|
|
|
|
|
public Dictionary<AlertKey, AlertState> Alerts { get; }
|
|
|
|
|
public AlertComponentState(Dictionary<AlertKey, AlertState> alerts)
|
|
|
|
|
{
|
|
|
|
|
Alerts = alerts;
|
|
|
|
|
}
|
|
|
|
|
}
|