CatStation/Content.Shared/SSDIndicator/SSDIndicatorComponent.cs
SlamBamActionman 19bc31aef7
Add "new player label" over the head of players joining the game for the first time (#44709)
* Initial commit

* RMC? I 'ardly know 'er

* Sprout

* Rework it to use job icons

* Revert the one change

* Always the one yaml

* Easy review changes

* We do a little salami

* Review changes

* NIGHTMARE NIGHTMARE NIGHTMARE

* Update to use StatusIconPrototype only

* Remove async

* Aaaand remove the comment, bah

* Review fixes

* Update master

* Add the ability for ghosts to see

* Byte backing

* Review fix + comment

* Update to 90 min

* Add todo message
2026-09-24 15:34:37 +00:00

49 lines
1.6 KiB
C#

using Content.Shared.CCVar;
using Content.Shared.StatusIcon;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.SSDIndicator;
/// <summary>
/// Shows status icon when an entity is SSD, based on if a player is attached or not.
/// </summary>
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class SSDIndicatorComponent : Component
{
/// <summary>
/// Whether or not the entity is SSD.
/// </summary>
[AutoNetworkedField]
[DataField, ViewVariables(VVAccess.ReadOnly)]
public bool IsSSD = true;
/// <summary>
/// The icon displayed next to the associated entity when it is SSD.
/// </summary>
[DataField]
public ProtoId<StatusIconPrototype> Icon = "SSDIcon";
/// <summary>
/// The time at which the entity will fall asleep, if <see cref="CCVars.ICSSDSleep"/> is true.
/// </summary>
[AutoNetworkedField, AutoPausedField]
[Access(typeof(SSDIndicatorSystem))]
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan FallAsleepTime = TimeSpan.Zero;
/// <summary>
/// The next time this component will be updated.
/// </summary>
[AutoNetworkedField, AutoPausedField]
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
public TimeSpan NextUpdate = TimeSpan.Zero;
/// <summary>
/// The time between updates checking if the entity should be force slept.
/// </summary>
[DataField]
public TimeSpan UpdateInterval = TimeSpan.FromSeconds(1);
}