Files
wwdpublic/Content.Shared/Alert/AlertsComponent.cs
SlamBamActionman e3259c077e Add a Walking alert (#32954)
* Initial commit

* Review feedback changes

* ProtoId

* TempCommit

* First attempt to have client alerts

* Review changes

(cherry picked from commit 1e368ae30076606501332f34ab786c14e25c477a)
2025-07-20 14:17:46 +10:00

30 lines
907 B
C#

using Robust.Shared.GameStates;
using Robust.Shared.Serialization;
namespace Content.Shared.Alert;
/// <summary>
/// Handles the icons on the right side of the screen.
/// Should only be used for player-controlled entities.
/// </summary>
// 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]
public sealed partial class AlertsComponent : Component
{
[ViewVariables]
public Dictionary<AlertKey, AlertState> Alerts = new();
public override bool SendOnlyToOwner => true;
}
[Serializable, NetSerializable]
public sealed class AlertComponentState : ComponentState
{
public Dictionary<AlertKey, AlertState> Alerts { get; }
public AlertComponentState(Dictionary<AlertKey, AlertState> alerts)
{
Alerts = alerts;
}
}