SSD sleep take 2 (#34039)

* ssd sleep part 2

* forgot this

* apply review

* yeah

* add onmapinit

* cache cvar values

---------

Co-authored-by: EmoGarbage404 <retron404@gmail.com>
This commit is contained in:
lzk
2025-04-29 07:24:33 +02:00
committed by GitHub
parent e21944d083
commit 207d513666
3 changed files with 94 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
using Content.Shared.StatusIcon;
using Content.Shared.StatusIcon;
using Robust.Shared.GameStates;
using Robust.Shared.Prototypes;
using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototype;
@@ -9,7 +9,7 @@ namespace Content.Shared.SSDIndicator;
/// Shows status icon when player in SSD
/// </summary>
[RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState]
[AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class SSDIndicatorComponent : Component
{
[ViewVariables(VVAccess.ReadWrite)]
@@ -19,4 +19,17 @@ public sealed partial class SSDIndicatorComponent : Component
[ViewVariables(VVAccess.ReadWrite)]
[DataField]
public ProtoId<SsdIconPrototype> Icon = "SSDIcon";
/// <summary>
/// When the entity should fall asleep
/// </summary>
[DataField, AutoPausedField, Access(typeof(SSDIndicatorSystem))]
public TimeSpan FallAsleepTime = TimeSpan.Zero;
/// <summary>
/// Required to don't remove forced sleep from other sources
/// </summary>
[ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField]
public bool ForcedSleepAdded = false;
}