Use new ComponentPauseGenerator (#25183)

Also includes some (non critical) changes to the solution file to re-organize the Roslyn components.
This commit is contained in:
Pieter-Jan Briers
2024-02-26 04:36:19 +01:00
committed by GitHub
parent 2a2324ecaf
commit e00f74505c
130 changed files with 150 additions and 539 deletions

View File

@@ -33,9 +33,7 @@ public sealed partial class AnomalySystem
SubscribeLocalEvent<AnomalyGeneratorComponent, MaterialAmountChangedEvent>(OnGeneratorMaterialAmountChanged); SubscribeLocalEvent<AnomalyGeneratorComponent, MaterialAmountChangedEvent>(OnGeneratorMaterialAmountChanged);
SubscribeLocalEvent<AnomalyGeneratorComponent, AnomalyGeneratorGenerateButtonPressedEvent>(OnGenerateButtonPressed); SubscribeLocalEvent<AnomalyGeneratorComponent, AnomalyGeneratorGenerateButtonPressedEvent>(OnGenerateButtonPressed);
SubscribeLocalEvent<AnomalyGeneratorComponent, PowerChangedEvent>(OnGeneratorPowerChanged); SubscribeLocalEvent<AnomalyGeneratorComponent, PowerChangedEvent>(OnGeneratorPowerChanged);
SubscribeLocalEvent<AnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratorUnpaused);
SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, ComponentStartup>(OnGeneratingStartup); SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, ComponentStartup>(OnGeneratingStartup);
SubscribeLocalEvent<GeneratingAnomalyGeneratorComponent, EntityUnpausedEvent>(OnGeneratingUnpaused);
} }
private void OnGeneratorPowerChanged(EntityUid uid, AnomalyGeneratorComponent component, ref PowerChangedEvent args) private void OnGeneratorPowerChanged(EntityUid uid, AnomalyGeneratorComponent component, ref PowerChangedEvent args)
@@ -58,11 +56,6 @@ public sealed partial class AnomalySystem
TryGeneratorCreateAnomaly(uid, component); TryGeneratorCreateAnomaly(uid, component);
} }
private void OnGeneratorUnpaused(EntityUid uid, AnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
{
component.CooldownEndTime += args.PausedTime;
}
public void UpdateGeneratorUi(EntityUid uid, AnomalyGeneratorComponent component) public void UpdateGeneratorUi(EntityUid uid, AnomalyGeneratorComponent component)
{ {
var materialAmount = _material.GetMaterialAmount(uid, component.RequiredMaterial); var materialAmount = _material.GetMaterialAmount(uid, component.RequiredMaterial);
@@ -169,11 +162,6 @@ public sealed partial class AnomalySystem
Appearance.SetData(uid, AnomalyGeneratorVisuals.Generating, true); Appearance.SetData(uid, AnomalyGeneratorVisuals.Generating, true);
} }
private void OnGeneratingUnpaused(EntityUid uid, GeneratingAnomalyGeneratorComponent component, ref EntityUnpausedEvent args)
{
component.EndTime += args.PausedTime;
}
private void OnGeneratingFinished(EntityUid uid, AnomalyGeneratorComponent component) private void OnGeneratingFinished(EntityUid uid, AnomalyGeneratorComponent component)
{ {
var xform = Transform(uid); var xform = Transform(uid);

View File

@@ -22,7 +22,6 @@ public sealed partial class AnomalySystem
SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing); SubscribeLocalEvent<AnomalyVesselComponent, InteractUsingEvent>(OnVesselInteractUsing);
SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined); SubscribeLocalEvent<AnomalyVesselComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<AnomalyVesselComponent, ResearchServerGetPointsPerSecondEvent>(OnVesselGetPointsPerSecond); SubscribeLocalEvent<AnomalyVesselComponent, ResearchServerGetPointsPerSecondEvent>(OnVesselGetPointsPerSecond);
SubscribeLocalEvent<AnomalyVesselComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<AnomalyShutdownEvent>(OnShutdown); SubscribeLocalEvent<AnomalyShutdownEvent>(OnShutdown);
SubscribeLocalEvent<AnomalyStabilityChangedEvent>(OnStabilityChanged); SubscribeLocalEvent<AnomalyStabilityChangedEvent>(OnStabilityChanged);
} }
@@ -92,11 +91,6 @@ public sealed partial class AnomalySystem
args.Points += (int) (GetAnomalyPointValue(anomaly) * component.PointMultiplier); args.Points += (int) (GetAnomalyPointValue(anomaly) * component.PointMultiplier);
} }
private void OnUnpaused(EntityUid uid, AnomalyVesselComponent component, ref EntityUnpausedEvent args)
{
component.NextBeep += args.PausedTime;
}
private void OnVesselAnomalyShutdown(ref AnomalyShutdownEvent args) private void OnVesselAnomalyShutdown(ref AnomalyShutdownEvent args)
{ {
var query = EntityQueryEnumerator<AnomalyVesselComponent>(); var query = EntityQueryEnumerator<AnomalyVesselComponent>();

View File

@@ -12,13 +12,14 @@ namespace Content.Server.Anomaly.Components;
/// This is used for a machine that is able to generate /// This is used for a machine that is able to generate
/// anomalies randomly on the station. /// anomalies randomly on the station.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(SharedAnomalySystem))] [RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
public sealed partial class AnomalyGeneratorComponent : Component public sealed partial class AnomalyGeneratorComponent : Component
{ {
/// <summary> /// <summary>
/// The time at which the cooldown for generating another anomaly will be over /// The time at which the cooldown for generating another anomaly will be over
/// </summary> /// </summary>
[DataField("cooldownEndTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("cooldownEndTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan CooldownEndTime = TimeSpan.Zero; public TimeSpan CooldownEndTime = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Anomaly.Components;
/// they generate points for the selected server based on /// they generate points for the selected server based on
/// the anomaly's stability and severity. /// the anomaly's stability and severity.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(SharedAnomalySystem))] [RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
public sealed partial class AnomalyVesselComponent : Component public sealed partial class AnomalyVesselComponent : Component
{ {
/// <summary> /// <summary>
@@ -42,6 +42,7 @@ public sealed partial class AnomalyVesselComponent : Component
/// When the next beep sound will play /// When the next beep sound will play
/// </summary> /// </summary>
[DataField("nextBeep", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("nextBeep", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextBeep = TimeSpan.Zero; public TimeSpan NextBeep = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -4,13 +4,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Anomaly.Components; namespace Content.Server.Anomaly.Components;
[RegisterComponent, Access(typeof(SharedAnomalySystem))] [RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
public sealed partial class GeneratingAnomalyGeneratorComponent : Component public sealed partial class GeneratingAnomalyGeneratorComponent : Component
{ {
/// <summary> /// <summary>
/// When the generating period will end. /// When the generating period will end.
/// </summary> /// </summary>
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan EndTime = TimeSpan.Zero; public TimeSpan EndTime = TimeSpan.Zero;
public EntityUid? AudioStream; public EntityUid? AudioStream;

View File

@@ -29,11 +29,9 @@ public sealed class RottingSystem : SharedRottingSystem
base.Initialize(); base.Initialize();
SubscribeLocalEvent<PerishableComponent, MapInitEvent>(OnPerishableMapInit); SubscribeLocalEvent<PerishableComponent, MapInitEvent>(OnPerishableMapInit);
SubscribeLocalEvent<PerishableComponent, EntityUnpausedEvent>(OnPerishableUnpaused);
SubscribeLocalEvent<PerishableComponent, MobStateChangedEvent>(OnMobStateChanged); SubscribeLocalEvent<PerishableComponent, MobStateChangedEvent>(OnMobStateChanged);
SubscribeLocalEvent<PerishableComponent, ExaminedEvent>(OnPerishableExamined); SubscribeLocalEvent<PerishableComponent, ExaminedEvent>(OnPerishableExamined);
SubscribeLocalEvent<RottingComponent, EntityUnpausedEvent>(OnRottingUnpaused);
SubscribeLocalEvent<RottingComponent, ComponentShutdown>(OnShutdown); SubscribeLocalEvent<RottingComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<RottingComponent, MobStateChangedEvent>(OnRottingMobStateChanged); SubscribeLocalEvent<RottingComponent, MobStateChangedEvent>(OnRottingMobStateChanged);
SubscribeLocalEvent<RottingComponent, BeingGibbedEvent>(OnGibbed); SubscribeLocalEvent<RottingComponent, BeingGibbedEvent>(OnGibbed);
@@ -47,11 +45,6 @@ public sealed class RottingSystem : SharedRottingSystem
component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate; component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate;
} }
private void OnPerishableUnpaused(EntityUid uid, PerishableComponent component, ref EntityUnpausedEvent args)
{
component.RotNextUpdate += args.PausedTime;
}
private void OnMobStateChanged(EntityUid uid, PerishableComponent component, MobStateChangedEvent args) private void OnMobStateChanged(EntityUid uid, PerishableComponent component, MobStateChangedEvent args)
{ {
if (args.NewMobState != MobState.Dead && args.OldMobState != MobState.Dead) if (args.NewMobState != MobState.Dead && args.OldMobState != MobState.Dead)
@@ -64,11 +57,6 @@ public sealed class RottingSystem : SharedRottingSystem
component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate; component.RotNextUpdate = _timing.CurTime + component.PerishUpdateRate;
} }
private void OnRottingUnpaused(EntityUid uid, RottingComponent component, ref EntityUnpausedEvent args)
{
component.NextRotUpdate += args.PausedTime;
}
private void OnShutdown(EntityUid uid, RottingComponent component, ComponentShutdown args) private void OnShutdown(EntityUid uid, RottingComponent component, ComponentShutdown args)
{ {
if (TryComp<PerishableComponent>(uid, out var perishable)) if (TryComp<PerishableComponent>(uid, out var perishable))

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Charges.Components;
/// Something with limited charges that can be recharged automatically. /// Something with limited charges that can be recharged automatically.
/// Requires LimitedChargesComponent to function. /// Requires LimitedChargesComponent to function.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(ChargesSystem))] [Access(typeof(ChargesSystem))]
public sealed partial class AutoRechargeComponent : Component public sealed partial class AutoRechargeComponent : Component
{ {
@@ -21,5 +21,6 @@ public sealed partial class AutoRechargeComponent : Component
/// The time when the next charge will be added /// The time when the next charge will be added
/// </summary> /// </summary>
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextChargeTime; public TimeSpan NextChargeTime;
} }

View File

@@ -10,13 +10,6 @@ public sealed class ChargesSystem : SharedChargesSystem
{ {
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<AutoRechargeComponent, EntityUnpausedEvent>(OnUnpaused);
}
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
base.Update(frameTime); base.Update(frameTime);
@@ -32,11 +25,6 @@ public sealed class ChargesSystem : SharedChargesSystem
} }
} }
private void OnUnpaused(EntityUid uid, AutoRechargeComponent comp, ref EntityUnpausedEvent args)
{
comp.NextChargeTime += args.PausedTime;
}
protected override void OnExamine(EntityUid uid, LimitedChargesComponent comp, ExaminedEvent args) protected override void OnExamine(EntityUid uid, LimitedChargesComponent comp, ExaminedEvent args)
{ {
base.OnExamine(uid, comp, args); base.OnExamine(uid, comp, args);

View File

@@ -8,7 +8,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom.Prototy
/// <summary> /// <summary>
/// Causes an entity to automatically emote when taking damage. /// Causes an entity to automatically emote when taking damage.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(EmoteOnDamageSystem))] [RegisterComponent, Access(typeof(EmoteOnDamageSystem)), AutoGenerateComponentPause]
public sealed partial class EmoteOnDamageComponent : Component public sealed partial class EmoteOnDamageComponent : Component
{ {
/// <summary> /// <summary>
@@ -41,6 +41,7 @@ public sealed partial class EmoteOnDamageComponent : Component
/// The simulation time of the last emote preformed due to taking damage. /// The simulation time of the last emote preformed due to taking damage.
/// </summary> /// </summary>
[DataField("lastEmoteTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("lastEmoteTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan LastEmoteTime = TimeSpan.Zero; public TimeSpan LastEmoteTime = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -18,15 +18,9 @@ public sealed class EmoteOnDamageSystem : EntitySystem
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<EmoteOnDamageComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<EmoteOnDamageComponent, DamageChangedEvent>(OnDamage); SubscribeLocalEvent<EmoteOnDamageComponent, DamageChangedEvent>(OnDamage);
} }
private void OnUnpaused(EntityUid uid, EmoteOnDamageComponent emoteOnDamage, ref EntityUnpausedEvent args)
{
emoteOnDamage.LastEmoteTime += args.PausedTime;
}
private void OnDamage(EntityUid uid, EmoteOnDamageComponent emoteOnDamage, DamageChangedEvent args) private void OnDamage(EntityUid uid, EmoteOnDamageComponent emoteOnDamage, DamageChangedEvent args)
{ {
if (!args.DamageIncreased) if (!args.DamageIncreased)

View File

@@ -9,7 +9,7 @@ namespace Content.Server.Chemistry.Components;
/// <summary> /// <summary>
/// Passively decreases a solution's quantity of reagent(s). /// Passively decreases a solution's quantity of reagent(s).
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(SolutionPurgeSystem))] [Access(typeof(SolutionPurgeSystem))]
public sealed partial class SolutionPurgeComponent : Component public sealed partial class SolutionPurgeComponent : Component
{ {
@@ -42,5 +42,6 @@ public sealed partial class SolutionPurgeComponent : Component
/// The time when the next purge will occur. /// The time when the next purge will occur.
/// </summary> /// </summary>
[DataField("nextPurgeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("nextPurgeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextPurgeTime = TimeSpan.FromSeconds(0); public TimeSpan NextPurgeTime = TimeSpan.FromSeconds(0);
} }

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Chemistry.Components;
/// <summary> /// <summary>
/// Passively increases a solution's quantity of a reagent. /// Passively increases a solution's quantity of a reagent.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(SolutionRegenerationSystem))] [Access(typeof(SolutionRegenerationSystem))]
public sealed partial class SolutionRegenerationComponent : Component public sealed partial class SolutionRegenerationComponent : Component
{ {
@@ -39,5 +39,6 @@ public sealed partial class SolutionRegenerationComponent : Component
/// The time when the next regeneration will occur. /// The time when the next regeneration will occur.
/// </summary> /// </summary>
[DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("nextChargeTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0); public TimeSpan NextRegenTime = TimeSpan.FromSeconds(0);
} }

View File

@@ -10,13 +10,6 @@ public sealed class SolutionPurgeSystem : EntitySystem
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SolutionPurgeComponent, EntityUnpausedEvent>(OnUnpaused);
}
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
base.Update(frameTime); base.Update(frameTime);
@@ -33,9 +26,4 @@ public sealed class SolutionPurgeSystem : EntitySystem
_solutionContainer.SplitSolutionWithout(solution.Value, purge.Quantity, purge.Preserve.ToArray()); _solutionContainer.SplitSolutionWithout(solution.Value, purge.Quantity, purge.Preserve.ToArray());
} }
} }
private void OnUnpaused(Entity<SolutionPurgeComponent> entity, ref EntityUnpausedEvent args)
{
entity.Comp.NextPurgeTime += args.PausedTime;
}
} }

View File

@@ -12,13 +12,6 @@ public sealed class SolutionRegenerationSystem : EntitySystem
[Dependency] private readonly SolutionContainerSystem _solutionContainer = default!; [Dependency] private readonly SolutionContainerSystem _solutionContainer = default!;
[Dependency] private readonly IGameTiming _timing = default!; [Dependency] private readonly IGameTiming _timing = default!;
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SolutionRegenerationComponent, EntityUnpausedEvent>(OnUnpaused);
}
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
base.Update(frameTime); base.Update(frameTime);
@@ -52,9 +45,4 @@ public sealed class SolutionRegenerationSystem : EntitySystem
} }
} }
} }
private void OnUnpaused(Entity<SolutionRegenerationComponent> entity, ref EntityUnpausedEvent args)
{
entity.Comp.NextRegenTime += args.PausedTime;
}
} }

View File

@@ -68,7 +68,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
// Shouldn't need re-anchoring. // Shouldn't need re-anchoring.
SubscribeLocalEvent<DisposalUnitComponent, AnchorStateChangedEvent>(OnAnchorChanged); SubscribeLocalEvent<DisposalUnitComponent, AnchorStateChangedEvent>(OnAnchorChanged);
SubscribeLocalEvent<DisposalUnitComponent, EntityUnpausedEvent>(OnUnpaused);
// TODO: Predict me when hands predicted // TODO: Predict me when hands predicted
SubscribeLocalEvent<DisposalUnitComponent, ContainerRelayMovementEntityEvent>(OnMovement); SubscribeLocalEvent<DisposalUnitComponent, ContainerRelayMovementEntityEvent>(OnMovement);
SubscribeLocalEvent<DisposalUnitComponent, PowerChangedEvent>(OnPowerChange); SubscribeLocalEvent<DisposalUnitComponent, PowerChangedEvent>(OnPowerChange);
@@ -103,14 +102,6 @@ public sealed class DisposalUnitSystem : SharedDisposalUnitSystem
GetNetEntityList(component.RecentlyEjected)); GetNetEntityList(component.RecentlyEjected));
} }
private void OnUnpaused(EntityUid uid, SharedDisposalUnitComponent component, ref EntityUnpausedEvent args)
{
if (component.NextFlush != null)
component.NextFlush = component.NextFlush.Value + args.PausedTime;
component.NextPressurized += args.PausedTime;
}
private void AddDisposalAltVerbs(EntityUid uid, SharedDisposalUnitComponent component, GetVerbsEvent<AlternativeVerb> args) private void AddDisposalAltVerbs(EntityUid uid, SharedDisposalUnitComponent component, GetVerbsEvent<AlternativeVerb> args)
{ {
if (!args.CanAccess || !args.CanInteract) if (!args.CanAccess || !args.CanInteract)

View File

@@ -17,7 +17,6 @@ public sealed class EmpSystem : SharedEmpSystem
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<EmpDisabledComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<EmpDisabledComponent, ExaminedEvent>(OnExamine); SubscribeLocalEvent<EmpDisabledComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<EmpOnTriggerComponent, TriggerEvent>(HandleEmpTrigger); SubscribeLocalEvent<EmpOnTriggerComponent, TriggerEvent>(HandleEmpTrigger);
@@ -96,12 +95,6 @@ public sealed class EmpSystem : SharedEmpSystem
} }
} }
private void OnUnpaused(EntityUid uid, EmpDisabledComponent component, ref EntityUnpausedEvent args)
{
component.DisabledUntil += args.PausedTime;
component.TargetTime += args.PausedTime;
}
private void OnExamine(EntityUid uid, EmpDisabledComponent component, ExaminedEvent args) private void OnExamine(EntityUid uid, EmpDisabledComponent component, ExaminedEvent args)
{ {
args.PushMarkup(Loc.GetString("emp-disabled-comp-on-examine")); args.PushMarkup(Loc.GetString("emp-disabled-comp-on-examine"));

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Explosion.Components.OnTrigger;
/// <summary> /// <summary>
/// After being triggered applies the specified components and runs triggers again. /// After being triggered applies the specified components and runs triggers again.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class TwoStageTriggerComponent : Component public sealed partial class TwoStageTriggerComponent : Component
{ {
/// <summary> /// <summary>
@@ -23,6 +23,7 @@ public sealed partial class TwoStageTriggerComponent : Component
public ComponentRegistry SecondStageComponents = new(); public ComponentRegistry SecondStageComponents = new();
[DataField("nextTriggerTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("nextTriggerTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan? NextTriggerTime; public TimeSpan? NextTriggerTime;
[DataField("triggered")] [DataField("triggered")]

View File

@@ -13,7 +13,7 @@ namespace Content.Server.Explosion.Components
/// <summary> /// <summary>
/// Raises a <see cref="TriggerEvent"/> whenever an entity collides with a fixture attached to the owner of this component. /// Raises a <see cref="TriggerEvent"/> whenever an entity collides with a fixture attached to the owner of this component.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class TriggerOnProximityComponent : SharedTriggerOnProximityComponent public sealed partial class TriggerOnProximityComponent : SharedTriggerOnProximityComponent
{ {
public const string FixtureID = "trigger-on-proximity-fixture"; public const string FixtureID = "trigger-on-proximity-fixture";
@@ -58,6 +58,7 @@ namespace Content.Server.Explosion.Components
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("nextTrigger", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("nextTrigger", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextTrigger = TimeSpan.Zero; public TimeSpan NextTrigger = TimeSpan.Zero;
/// <summary> /// <summary>
@@ -65,6 +66,7 @@ namespace Content.Server.Explosion.Components
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField("nextVisualUpdate", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("nextVisualUpdate", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextVisualUpdate = TimeSpan.Zero; public TimeSpan NextVisualUpdate = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -17,7 +17,6 @@ public sealed partial class TriggerSystem
SubscribeLocalEvent<TriggerOnProximityComponent, StartCollideEvent>(OnProximityStartCollide); SubscribeLocalEvent<TriggerOnProximityComponent, StartCollideEvent>(OnProximityStartCollide);
SubscribeLocalEvent<TriggerOnProximityComponent, EndCollideEvent>(OnProximityEndCollide); SubscribeLocalEvent<TriggerOnProximityComponent, EndCollideEvent>(OnProximityEndCollide);
SubscribeLocalEvent<TriggerOnProximityComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<TriggerOnProximityComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<TriggerOnProximityComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<TriggerOnProximityComponent, ComponentShutdown>(OnProximityShutdown); SubscribeLocalEvent<TriggerOnProximityComponent, ComponentShutdown>(OnProximityShutdown);
// Shouldn't need re-anchoring. // Shouldn't need re-anchoring.
SubscribeLocalEvent<TriggerOnProximityComponent, AnchorStateChangedEvent>(OnProximityAnchor); SubscribeLocalEvent<TriggerOnProximityComponent, AnchorStateChangedEvent>(OnProximityAnchor);
@@ -65,12 +64,6 @@ public sealed partial class TriggerSystem
collisionLayer: component.Layer); collisionLayer: component.Layer);
} }
private void OnUnpaused(EntityUid uid, TriggerOnProximityComponent component, ref EntityUnpausedEvent args)
{
component.NextTrigger += args.PausedTime;
component.NextVisualUpdate += args.PausedTime;
}
private void OnProximityStartCollide(EntityUid uid, TriggerOnProximityComponent component, ref StartCollideEvent args) private void OnProximityStartCollide(EntityUid uid, TriggerOnProximityComponent component, ref StartCollideEvent args)
{ {
if (args.OurFixtureId != TriggerOnProximityComponent.FixtureID) if (args.OurFixtureId != TriggerOnProximityComponent.FixtureID)

View File

@@ -14,16 +14,9 @@ public sealed class TwoStageTriggerSystem : EntitySystem
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<TwoStageTriggerComponent, EntityUnpausedEvent>(OnTriggerUnpaused);
SubscribeLocalEvent<TwoStageTriggerComponent, TriggerEvent>(OnTrigger); SubscribeLocalEvent<TwoStageTriggerComponent, TriggerEvent>(OnTrigger);
} }
private void OnTriggerUnpaused(EntityUid uid, TwoStageTriggerComponent component, ref EntityUnpausedEvent args)
{
if (component.NextTriggerTime != null)
component.NextTriggerTime = component.NextTriggerTime.Value + args.PausedTime;
}
private void OnTrigger(EntityUid uid, TwoStageTriggerComponent component, TriggerEvent args) private void OnTrigger(EntityUid uid, TwoStageTriggerComponent component, TriggerEvent args)
{ {
if (component.Triggered) if (component.Triggered)

View File

@@ -63,7 +63,6 @@ public sealed class SmokeSystem : EntitySystem
SubscribeLocalEvent<SmokeComponent, ReactionAttemptEvent>(OnReactionAttempt); SubscribeLocalEvent<SmokeComponent, ReactionAttemptEvent>(OnReactionAttempt);
SubscribeLocalEvent<SmokeComponent, SolutionRelayEvent<ReactionAttemptEvent>>(OnReactionAttempt); SubscribeLocalEvent<SmokeComponent, SolutionRelayEvent<ReactionAttemptEvent>>(OnReactionAttempt);
SubscribeLocalEvent<SmokeComponent, SpreadNeighborsEvent>(OnSmokeSpread); SubscribeLocalEvent<SmokeComponent, SpreadNeighborsEvent>(OnSmokeSpread);
SubscribeLocalEvent<SmokeAffectedComponent, EntityUnpausedEvent>(OnAffectedUnpaused);
} }
/// <inheritdoc/> /// <inheritdoc/>
@@ -124,11 +123,6 @@ public sealed class SmokeSystem : EntitySystem
RemComp(args.OtherEntity, smokeAffectedComponent); RemComp(args.OtherEntity, smokeAffectedComponent);
} }
private void OnAffectedUnpaused(Entity<SmokeAffectedComponent> entity, ref EntityUnpausedEvent args)
{
entity.Comp.NextSecond += args.PausedTime;
}
private void OnSmokeSpread(Entity<SmokeComponent> entity, ref SpreadNeighborsEvent args) private void OnSmokeSpread(Entity<SmokeComponent> entity, ref SpreadNeighborsEvent args)
{ {
if (entity.Comp.SpreadAmount == 0 || !_solutionContainerSystem.ResolveSolution(entity.Owner, SmokeComponent.SolutionName, ref entity.Comp.Solution, out var solution)) if (entity.Comp.SpreadAmount == 0 || !_solutionContainerSystem.ResolveSolution(entity.Owner, SmokeComponent.SolutionName, ref entity.Comp.Solution, out var solution))

View File

@@ -8,7 +8,7 @@ namespace Content.Server.Gateway.Components;
/// <summary> /// <summary>
/// Controlling gateway that links to other gateway destinations on the server. /// Controlling gateway that links to other gateway destinations on the server.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(GatewaySystem))] [RegisterComponent, Access(typeof(GatewaySystem)), AutoGenerateComponentPause]
public sealed partial class GatewayComponent : Component public sealed partial class GatewayComponent : Component
{ {
/// <summary> /// <summary>
@@ -61,5 +61,6 @@ public sealed partial class GatewayComponent : Component
/// The time at which the portal can next be opened. /// The time at which the portal can next be opened.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextReady; public TimeSpan NextReady;
} }

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Gateway.Components;
/// <summary> /// <summary>
/// Generates gateway destinations at a regular interval. /// Generates gateway destinations at a regular interval.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class GatewayGeneratorComponent : Component public sealed partial class GatewayGeneratorComponent : Component
{ {
/// <summary> /// <summary>
@@ -20,6 +20,7 @@ public sealed partial class GatewayGeneratorComponent : Component
/// Next time another seed unlocks. /// Next time another seed unlocks.
/// </summary> /// </summary>
[DataField(customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextUnlock; public TimeSpan NextUnlock;
/// <summary> /// <summary>

View File

@@ -67,7 +67,6 @@ public sealed class GatewayGeneratorSystem : EntitySystem
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<GatewayGeneratorComponent, EntityUnpausedEvent>(OnGeneratorUnpaused);
SubscribeLocalEvent<GatewayGeneratorComponent, MapInitEvent>(OnGeneratorMapInit); SubscribeLocalEvent<GatewayGeneratorComponent, MapInitEvent>(OnGeneratorMapInit);
SubscribeLocalEvent<GatewayGeneratorComponent, ComponentShutdown>(OnGeneratorShutdown); SubscribeLocalEvent<GatewayGeneratorComponent, ComponentShutdown>(OnGeneratorShutdown);
SubscribeLocalEvent<GatewayGeneratorDestinationComponent, AttemptGatewayOpenEvent>(OnGeneratorAttemptOpen); SubscribeLocalEvent<GatewayGeneratorDestinationComponent, AttemptGatewayOpenEvent>(OnGeneratorAttemptOpen);
@@ -85,11 +84,6 @@ public sealed class GatewayGeneratorSystem : EntitySystem
} }
} }
private void OnGeneratorUnpaused(Entity<GatewayGeneratorComponent> ent, ref EntityUnpausedEvent args)
{
ent.Comp.NextUnlock += args.PausedTime;
}
private void OnGeneratorMapInit(EntityUid uid, GatewayGeneratorComponent generator, MapInitEvent args) private void OnGeneratorMapInit(EntityUid uid, GatewayGeneratorComponent generator, MapInitEvent args)
{ {
if (!_cfgManager.GetCVar(CCVars.GatewayGeneratorEnabled)) if (!_cfgManager.GetCVar(CCVars.GatewayGeneratorEnabled))

View File

@@ -32,7 +32,6 @@ public sealed class GatewaySystem : EntitySystem
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<GatewayComponent, EntityUnpausedEvent>(OnGatewayUnpaused);
SubscribeLocalEvent<GatewayComponent, ComponentStartup>(OnStartup); SubscribeLocalEvent<GatewayComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<GatewayComponent, ActivatableUIOpenAttemptEvent>(OnGatewayOpenAttempt); SubscribeLocalEvent<GatewayComponent, ActivatableUIOpenAttemptEvent>(OnGatewayOpenAttempt);
SubscribeLocalEvent<GatewayComponent, BoundUIOpenedEvent>(UpdateUserInterface); SubscribeLocalEvent<GatewayComponent, BoundUIOpenedEvent>(UpdateUserInterface);
@@ -48,11 +47,6 @@ public sealed class GatewaySystem : EntitySystem
UpdateAllGateways(); UpdateAllGateways();
} }
private void OnGatewayUnpaused(EntityUid uid, GatewayComponent component, ref EntityUnpausedEvent args)
{
component.NextReady += args.PausedTime;
}
private void OnStartup(EntityUid uid, GatewayComponent comp, ComponentStartup args) private void OnStartup(EntityUid uid, GatewayComponent comp, ComponentStartup args)
{ {
// no need to update ui since its just been created, just do portal // no need to update ui since its just been created, just do portal

View File

@@ -52,7 +52,6 @@ namespace Content.Server.Hands.Systems
SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved); SubscribeLocalEvent<HandsComponent, BodyPartRemovedEvent>(HandleBodyPartRemoved);
SubscribeLocalEvent<HandsComponent, ComponentGetState>(GetComponentState); SubscribeLocalEvent<HandsComponent, ComponentGetState>(GetComponentState);
SubscribeLocalEvent<HandsComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<HandsComponent, BeforeExplodeEvent>(OnExploded); SubscribeLocalEvent<HandsComponent, BeforeExplodeEvent>(OnExploded);
@@ -73,10 +72,6 @@ namespace Content.Server.Hands.Systems
args.State = new HandsComponentState(hands); args.State = new HandsComponentState(hands);
} }
private void OnUnpaused(Entity<HandsComponent> ent, ref EntityUnpausedEvent args)
{
ent.Comp.NextThrowTime += args.PausedTime;
}
private void OnExploded(Entity<HandsComponent> ent, ref BeforeExplodeEvent args) private void OnExploded(Entity<HandsComponent> ent, ref BeforeExplodeEvent args)
{ {

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Kitchen.Components;
/// <summary> /// <summary>
/// Attached to a microwave that is currently in the process of cooking /// Attached to a microwave that is currently in the process of cooking
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class ActiveMicrowaveComponent : Component public sealed partial class ActiveMicrowaveComponent : Component
{ {
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
@@ -17,6 +17,7 @@ public sealed partial class ActiveMicrowaveComponent : Component
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan MalfunctionTime = TimeSpan.Zero; public TimeSpan MalfunctionTime = TimeSpan.Zero;
[ViewVariables] [ViewVariables]

View File

@@ -86,7 +86,6 @@ namespace Content.Server.Kitchen.EntitySystems
SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentStartup>(OnCookStart); SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentStartup>(OnCookStart);
SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentShutdown>(OnCookStop); SubscribeLocalEvent<ActiveMicrowaveComponent, ComponentShutdown>(OnCookStop);
SubscribeLocalEvent<ActiveMicrowaveComponent, EntityUnpausedEvent>(OnEntityUnpaused);
SubscribeLocalEvent<ActiveMicrowaveComponent, EntInsertedIntoContainerMessage>(OnActiveMicrowaveInsert); SubscribeLocalEvent<ActiveMicrowaveComponent, EntInsertedIntoContainerMessage>(OnActiveMicrowaveInsert);
SubscribeLocalEvent<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove); SubscribeLocalEvent<ActiveMicrowaveComponent, EntRemovedFromContainerMessage>(OnActiveMicrowaveRemove);
@@ -112,11 +111,6 @@ namespace Content.Server.Kitchen.EntitySystems
microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream); microwaveComponent.PlayingStream = _audio.Stop(microwaveComponent.PlayingStream);
} }
private void OnEntityUnpaused(Entity<ActiveMicrowaveComponent> ent, ref EntityUnpausedEvent args)
{
ent.Comp.MalfunctionTime += args.PausedTime;
}
private void OnActiveMicrowaveInsert(Entity<ActiveMicrowaveComponent> ent, ref EntInsertedIntoContainerMessage args) private void OnActiveMicrowaveInsert(Entity<ActiveMicrowaveComponent> ent, ref EntInsertedIntoContainerMessage args)
{ {
AddComp<ActivelyMicrowavedComponent>(args.Entity); AddComp<ActivelyMicrowavedComponent>(args.Entity);

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Medical.Components;
/// <summary> /// <summary>
/// After scanning, retrieves the target Uid to use with its related UI. /// After scanning, retrieves the target Uid to use with its related UI.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(HealthAnalyzerSystem), typeof(CryoPodSystem))] [Access(typeof(HealthAnalyzerSystem), typeof(CryoPodSystem))]
public sealed partial class HealthAnalyzerComponent : Component public sealed partial class HealthAnalyzerComponent : Component
{ {
@@ -14,6 +14,7 @@ public sealed partial class HealthAnalyzerComponent : Component
/// When should the next update be sent for the patient /// When should the next update be sent for the patient
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextUpdate = TimeSpan.Zero; public TimeSpan NextUpdate = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -50,21 +50,12 @@ public sealed class DefibrillatorSystem : EntitySystem
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()
{ {
SubscribeLocalEvent<DefibrillatorComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<DefibrillatorComponent, UseInHandEvent>(OnUseInHand); SubscribeLocalEvent<DefibrillatorComponent, UseInHandEvent>(OnUseInHand);
SubscribeLocalEvent<DefibrillatorComponent, PowerCellSlotEmptyEvent>(OnPowerCellSlotEmpty); SubscribeLocalEvent<DefibrillatorComponent, PowerCellSlotEmptyEvent>(OnPowerCellSlotEmpty);
SubscribeLocalEvent<DefibrillatorComponent, AfterInteractEvent>(OnAfterInteract); SubscribeLocalEvent<DefibrillatorComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<DefibrillatorComponent, DefibrillatorZapDoAfterEvent>(OnDoAfter); SubscribeLocalEvent<DefibrillatorComponent, DefibrillatorZapDoAfterEvent>(OnDoAfter);
} }
private void OnUnpaused(EntityUid uid, DefibrillatorComponent component, ref EntityUnpausedEvent args)
{
if (component.NextZapTime == null)
return;
component.NextZapTime = component.NextZapTime.Value + args.PausedTime;
}
private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args) private void OnUseInHand(EntityUid uid, DefibrillatorComponent component, UseInHandEvent args)
{ {
if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay))) if (args.Handled || !TryComp(uid, out UseDelayComponent? useDelay) || _useDelay.IsDelayed((uid, useDelay)))

View File

@@ -30,7 +30,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
public override void Initialize() public override void Initialize()
{ {
SubscribeLocalEvent<HealthAnalyzerComponent, EntityUnpausedEvent>(OnEntityUnpaused);
SubscribeLocalEvent<HealthAnalyzerComponent, AfterInteractEvent>(OnAfterInteract); SubscribeLocalEvent<HealthAnalyzerComponent, AfterInteractEvent>(OnAfterInteract);
SubscribeLocalEvent<HealthAnalyzerComponent, HealthAnalyzerDoAfterEvent>(OnDoAfter); SubscribeLocalEvent<HealthAnalyzerComponent, HealthAnalyzerDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<HealthAnalyzerComponent, EntGotInsertedIntoContainerMessage>(OnInsertedIntoContainer); SubscribeLocalEvent<HealthAnalyzerComponent, EntGotInsertedIntoContainerMessage>(OnInsertedIntoContainer);
@@ -65,11 +64,6 @@ public sealed class HealthAnalyzerSystem : EntitySystem
} }
} }
private void OnEntityUnpaused(Entity<HealthAnalyzerComponent> ent, ref EntityUnpausedEvent args)
{
ent.Comp.NextUpdate += args.PausedTime;
}
/// <summary> /// <summary>
/// Trigger the doafter for scanning /// Trigger the doafter for scanning
/// </summary> /// </summary>

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Medical.SuitSensors;
/// Tracking device, embedded in almost all uniforms and jumpsuits. /// Tracking device, embedded in almost all uniforms and jumpsuits.
/// If enabled, will report to crew monitoring console owners position and status. /// If enabled, will report to crew monitoring console owners position and status.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
[Access(typeof(SuitSensorSystem))] [Access(typeof(SuitSensorSystem))]
public sealed partial class SuitSensorComponent : Component public sealed partial class SuitSensorComponent : Component
{ {
@@ -57,6 +57,7 @@ public sealed partial class SuitSensorComponent : Component
/// Next time when sensor updated owners status /// Next time when sensor updated owners status
/// </summary> /// </summary>
[DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("nextUpdate", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextUpdate = TimeSpan.Zero; public TimeSpan NextUpdate = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -40,7 +40,6 @@ public sealed class SuitSensorSystem : EntitySystem
base.Initialize(); base.Initialize();
SubscribeLocalEvent<PlayerSpawnCompleteEvent>(OnPlayerSpawn); SubscribeLocalEvent<PlayerSpawnCompleteEvent>(OnPlayerSpawn);
SubscribeLocalEvent<SuitSensorComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<SuitSensorComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<SuitSensorComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<SuitSensorComponent, GotEquippedEvent>(OnEquipped); SubscribeLocalEvent<SuitSensorComponent, GotEquippedEvent>(OnEquipped);
SubscribeLocalEvent<SuitSensorComponent, GotUnequippedEvent>(OnUnequipped); SubscribeLocalEvent<SuitSensorComponent, GotUnequippedEvent>(OnUnequipped);
SubscribeLocalEvent<SuitSensorComponent, ExaminedEvent>(OnExamine); SubscribeLocalEvent<SuitSensorComponent, ExaminedEvent>(OnExamine);
@@ -51,11 +50,6 @@ public sealed class SuitSensorSystem : EntitySystem
SubscribeLocalEvent<SuitSensorComponent, EmpDisabledRemoved>(OnEmpFinished); SubscribeLocalEvent<SuitSensorComponent, EmpDisabledRemoved>(OnEmpFinished);
} }
private void OnUnpaused(EntityUid uid, SuitSensorComponent component, ref EntityUnpausedEvent args)
{
component.NextUpdate += args.PausedTime;
}
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
base.Update(frameTime); base.Update(frameTime);

View File

@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.NPC.Components; namespace Content.Server.NPC.Components;
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class NPCJukeComponent : Component public sealed partial class NPCJukeComponent : Component
{ {
[DataField("jukeType")] [DataField("jukeType")]
@@ -13,6 +13,7 @@ public sealed partial class NPCJukeComponent : Component
public float JukeDuration = 0.5f; public float JukeDuration = 0.5f;
[DataField("nextJuke", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("nextJuke", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextJuke; public TimeSpan NextJuke;
[DataField("targetTile")] [DataField("targetTile")]

View File

@@ -11,7 +11,7 @@ namespace Content.Server.NPC.Components;
/// <summary> /// <summary>
/// Added to NPCs that are moving. /// Added to NPCs that are moving.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class NPCSteeringComponent : Component public sealed partial class NPCSteeringComponent : Component
{ {
#region Context Steering #region Context Steering
@@ -49,6 +49,7 @@ public sealed partial class NPCSteeringComponent : Component
/// Next time we can change our steering direction. /// Next time we can change our steering direction.
/// </summary> /// </summary>
[DataField("nextSteer", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("nextSteer", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextSteer = TimeSpan.Zero; public TimeSpan NextSteer = TimeSpan.Zero;
[DataField("lastSteerIndex")] [DataField("lastSteerIndex")]
@@ -66,6 +67,7 @@ public sealed partial class NPCSteeringComponent : Component
public EntityCoordinates LastStuckCoordinates; public EntityCoordinates LastStuckCoordinates;
[DataField("lastStuckTime", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("lastStuckTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan LastStuckTime; public TimeSpan LastStuckTime;
public const float StuckDistance = 1f; public const float StuckDistance = 1f;

View File

@@ -5,7 +5,7 @@ namespace Content.Server.NPC.Pathfinding;
/// <summary> /// <summary>
/// Stores the relevant pathfinding data for grids. /// Stores the relevant pathfinding data for grids.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(PathfindingSystem))] [RegisterComponent, Access(typeof(PathfindingSystem)), AutoGenerateComponentPause]
public sealed partial class GridPathfindingComponent : Component public sealed partial class GridPathfindingComponent : Component
{ {
[ViewVariables] [ViewVariables]
@@ -15,6 +15,7 @@ public sealed partial class GridPathfindingComponent : Component
/// Next time the graph is allowed to update. /// Next time the graph is allowed to update.
/// </summary> /// </summary>
/// Removing this datafield is the lazy fix HOWEVER I want to purge this anyway and do pathfinding at runtime. /// Removing this datafield is the lazy fix HOWEVER I want to purge this anyway and do pathfinding at runtime.
[AutoPausedField]
public TimeSpan NextUpdate; public TimeSpan NextUpdate;
[ViewVariables] [ViewVariables]

View File

@@ -44,7 +44,6 @@ public sealed partial class PathfindingSystem
{ {
SubscribeLocalEvent<GridInitializeEvent>(OnGridInit); SubscribeLocalEvent<GridInitializeEvent>(OnGridInit);
SubscribeLocalEvent<GridRemovalEvent>(OnGridRemoved); SubscribeLocalEvent<GridRemovalEvent>(OnGridRemoved);
SubscribeLocalEvent<GridPathfindingComponent, EntityUnpausedEvent>(OnGridPathPause);
SubscribeLocalEvent<GridPathfindingComponent, ComponentShutdown>(OnGridPathShutdown); SubscribeLocalEvent<GridPathfindingComponent, ComponentShutdown>(OnGridPathShutdown);
SubscribeLocalEvent<CollisionChangeEvent>(OnCollisionChange); SubscribeLocalEvent<CollisionChangeEvent>(OnCollisionChange);
SubscribeLocalEvent<CollisionLayerChangeEvent>(OnCollisionLayerChange); SubscribeLocalEvent<CollisionLayerChangeEvent>(OnCollisionLayerChange);
@@ -61,10 +60,6 @@ public sealed partial class PathfindingSystem
DirtyChunk(ev.Entity, Comp<MapGridComponent>(ev.Entity).GridTileToLocal(ev.NewTile.GridIndices)); DirtyChunk(ev.Entity, Comp<MapGridComponent>(ev.Entity).GridTileToLocal(ev.NewTile.GridIndices));
} }
private void OnGridPathPause(EntityUid uid, GridPathfindingComponent component, ref EntityUnpausedEvent args)
{
component.NextUpdate += args.PausedTime;
}
private void OnGridPathShutdown(EntityUid uid, GridPathfindingComponent component, ComponentShutdown args) private void OnGridPathShutdown(EntityUid uid, GridPathfindingComponent component, ComponentShutdown args)
{ {

View File

@@ -33,15 +33,9 @@ public sealed class NPCJukeSystem : EntitySystem
_npcRangedQuery = GetEntityQuery<NPCRangedCombatComponent>(); _npcRangedQuery = GetEntityQuery<NPCRangedCombatComponent>();
_physicsQuery = GetEntityQuery<PhysicsComponent>(); _physicsQuery = GetEntityQuery<PhysicsComponent>();
SubscribeLocalEvent<NPCJukeComponent, EntityUnpausedEvent>(OnJukeUnpaused);
SubscribeLocalEvent<NPCJukeComponent, NPCSteeringEvent>(OnJukeSteering); SubscribeLocalEvent<NPCJukeComponent, NPCSteeringEvent>(OnJukeSteering);
} }
private void OnJukeUnpaused(EntityUid uid, NPCJukeComponent component, ref EntityUnpausedEvent args)
{
component.NextJuke += args.PausedTime;
}
private void OnJukeSteering(EntityUid uid, NPCJukeComponent component, ref NPCSteeringEvent args) private void OnJukeSteering(EntityUid uid, NPCJukeComponent component, ref NPCSteeringEvent args)
{ {
if (component.JukeType == JukeType.AdjacentTile) if (component.JukeType == JukeType.AdjacentTile)

View File

@@ -107,7 +107,6 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
Subs.CVar(_configManager, CCVars.NPCPathfinding, SetNPCPathfinding, true); Subs.CVar(_configManager, CCVars.NPCPathfinding, SetNPCPathfinding, true);
SubscribeLocalEvent<NPCSteeringComponent, ComponentShutdown>(OnSteeringShutdown); SubscribeLocalEvent<NPCSteeringComponent, ComponentShutdown>(OnSteeringShutdown);
SubscribeLocalEvent<NPCSteeringComponent, EntityUnpausedEvent>(OnSteeringUnpaused);
SubscribeNetworkEvent<RequestNPCSteeringDebugEvent>(OnDebugRequest); SubscribeNetworkEvent<RequestNPCSteeringDebugEvent>(OnDebugRequest);
} }
@@ -158,12 +157,6 @@ public sealed partial class NPCSteeringSystem : SharedNPCSteeringSystem
component.PathfindToken = null; component.PathfindToken = null;
} }
private void OnSteeringUnpaused(EntityUid uid, NPCSteeringComponent component, ref EntityUnpausedEvent args)
{
component.LastStuckTime += args.PausedTime;
component.NextSteer += args.PausedTime;
}
/// <summary> /// <summary>
/// Adds the AI to the steering system to move towards a specific target /// Adds the AI to the steering system to move towards a specific target
/// </summary> /// </summary>

View File

@@ -10,7 +10,7 @@ namespace Content.Server.Nutrition.Components;
/// <summary> /// <summary>
/// This is used for a machine that extracts hunger from entities and creates meat. Yum! /// This is used for a machine that extracts hunger from entities and creates meat. Yum!
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(FatExtractorSystem))] [RegisterComponent, Access(typeof(FatExtractorSystem)), AutoGenerateComponentPause]
public sealed partial class FatExtractorComponent : Component public sealed partial class FatExtractorComponent : Component
{ {
/// <summary> /// <summary>
@@ -48,6 +48,7 @@ public sealed partial class FatExtractorComponent : Component
/// When the next update will occur /// When the next update will occur
/// </summary> /// </summary>
[DataField("nextUpdate", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("nextUpdate", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextUpdate; public TimeSpan NextUpdate;
/// <summary> /// <summary>

View File

@@ -40,23 +40,11 @@ public sealed class AnimalHusbandrySystem : EntitySystem
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()
{ {
SubscribeLocalEvent<ReproductiveComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<ReproductiveComponent, MindAddedMessage>(OnMindAdded); SubscribeLocalEvent<ReproductiveComponent, MindAddedMessage>(OnMindAdded);
SubscribeLocalEvent<InfantComponent, EntityUnpausedEvent>(OnInfantUnpaused);
SubscribeLocalEvent<InfantComponent, ComponentStartup>(OnInfantStartup); SubscribeLocalEvent<InfantComponent, ComponentStartup>(OnInfantStartup);
SubscribeLocalEvent<InfantComponent, ComponentShutdown>(OnInfantShutdown); SubscribeLocalEvent<InfantComponent, ComponentShutdown>(OnInfantShutdown);
} }
private void OnUnpaused(EntityUid uid, ReproductiveComponent component, ref EntityUnpausedEvent args)
{
component.NextBreedAttempt += args.PausedTime;
}
private void OnInfantUnpaused(EntityUid uid, InfantComponent component, ref EntityUnpausedEvent args)
{
component.InfantEndTime += args.PausedTime;
}
// we express EZ-pass terminate the pregnancy if a player takes the role // we express EZ-pass terminate the pregnancy if a player takes the role
private void OnMindAdded(EntityUid uid, ReproductiveComponent component, MindAddedMessage args) private void OnMindAdded(EntityUid uid, ReproductiveComponent component, MindAddedMessage args)
{ {

View File

@@ -27,18 +27,12 @@ public sealed class FatExtractorSystem : EntitySystem
/// <inheritdoc/> /// <inheritdoc/>
public override void Initialize() public override void Initialize()
{ {
SubscribeLocalEvent<FatExtractorComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<FatExtractorComponent, GotEmaggedEvent>(OnGotEmagged); SubscribeLocalEvent<FatExtractorComponent, GotEmaggedEvent>(OnGotEmagged);
SubscribeLocalEvent<FatExtractorComponent, StorageAfterCloseEvent>(OnClosed); SubscribeLocalEvent<FatExtractorComponent, StorageAfterCloseEvent>(OnClosed);
SubscribeLocalEvent<FatExtractorComponent, StorageAfterOpenEvent>(OnOpen); SubscribeLocalEvent<FatExtractorComponent, StorageAfterOpenEvent>(OnOpen);
SubscribeLocalEvent<FatExtractorComponent, PowerChangedEvent>(OnPowerChanged); SubscribeLocalEvent<FatExtractorComponent, PowerChangedEvent>(OnPowerChanged);
} }
private void OnUnpaused(EntityUid uid, FatExtractorComponent component, ref EntityUnpausedEvent args)
{
component.NextUpdate += args.PausedTime;
}
private void OnGotEmagged(EntityUid uid, FatExtractorComponent component, ref GotEmaggedEvent args) private void OnGotEmagged(EntityUid uid, FatExtractorComponent component, ref GotEmaggedEvent args)
{ {
args.Handled = true; args.Handled = true;

View File

@@ -8,13 +8,14 @@ namespace Content.Server.Physics.Components;
/// <summary> /// <summary>
/// A component which makes its entity chasing entity with selected component. /// A component which makes its entity chasing entity with selected component.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(ChasingWalkSystem))] [RegisterComponent, Access(typeof(ChasingWalkSystem)), AutoGenerateComponentPause]
public sealed partial class ChasingWalkComponent : Component public sealed partial class ChasingWalkComponent : Component
{ {
/// <summary> /// <summary>
/// The next moment in time when the entity is pushed toward its goal /// The next moment in time when the entity is pushed toward its goal
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField, ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextImpulseTime; public TimeSpan NextImpulseTime;
/// <summary> /// <summary>
@@ -57,6 +58,7 @@ public sealed partial class ChasingWalkComponent : Component
/// The next change of direction time. /// The next change of direction time.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextChangeVectorTime; public TimeSpan NextChangeVectorTime;
/// <summary> /// <summary>

View File

@@ -27,7 +27,6 @@ public sealed class ChasingWalkSystem : VirtualController
base.Initialize(); base.Initialize();
SubscribeLocalEvent<ChasingWalkComponent, MapInitEvent>(OnChasingMapInit); SubscribeLocalEvent<ChasingWalkComponent, MapInitEvent>(OnChasingMapInit);
SubscribeLocalEvent<ChasingWalkComponent, EntityUnpausedEvent>(OnChasingUnpaused);
} }
private void OnChasingMapInit(EntityUid uid, ChasingWalkComponent component, MapInitEvent args) private void OnChasingMapInit(EntityUid uid, ChasingWalkComponent component, MapInitEvent args)
@@ -36,12 +35,6 @@ public sealed class ChasingWalkSystem : VirtualController
component.NextChangeVectorTime = _gameTiming.CurTime; component.NextChangeVectorTime = _gameTiming.CurTime;
} }
private void OnChasingUnpaused(EntityUid uid, ChasingWalkComponent component, ref EntityUnpausedEvent args)
{
component.NextImpulseTime += args.PausedTime;
component.NextChangeVectorTime += args.PausedTime;
}
public override void UpdateBeforeSolve(bool prediction, float frameTime) public override void UpdateBeforeSolve(bool prediction, float frameTime)
{ {
base.UpdateBeforeSolve(prediction, frameTime); base.UpdateBeforeSolve(prediction, frameTime);

View File

@@ -39,11 +39,6 @@ public sealed partial class PowerCellSystem
} }
} }
private void OnUnpaused(EntityUid uid, PowerCellDrawComponent component, ref EntityUnpausedEvent args)
{
component.NextUpdateTime += args.PausedTime;
}
private void OnDrawChargeChanged(EntityUid uid, PowerCellDrawComponent component, ref ChargeChangedEvent args) private void OnDrawChargeChanged(EntityUid uid, PowerCellDrawComponent component, ref ChargeChangedEvent args)
{ {
// Update the bools for client prediction. // Update the bools for client prediction.

View File

@@ -35,7 +35,6 @@ public sealed partial class PowerCellSystem : SharedPowerCellSystem
SubscribeLocalEvent<PowerCellComponent, ExaminedEvent>(OnCellExamined); SubscribeLocalEvent<PowerCellComponent, ExaminedEvent>(OnCellExamined);
SubscribeLocalEvent<PowerCellComponent, EmpAttemptEvent>(OnCellEmpAttempt); SubscribeLocalEvent<PowerCellComponent, EmpAttemptEvent>(OnCellEmpAttempt);
SubscribeLocalEvent<PowerCellDrawComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<PowerCellDrawComponent, ChargeChangedEvent>(OnDrawChargeChanged); SubscribeLocalEvent<PowerCellDrawComponent, ChargeChangedEvent>(OnDrawChargeChanged);
SubscribeLocalEvent<PowerCellDrawComponent, PowerCellChangedEvent>(OnDrawCellChanged); SubscribeLocalEvent<PowerCellDrawComponent, PowerCellChangedEvent>(OnDrawCellChanged);

View File

@@ -6,7 +6,7 @@ namespace Content.Server.PowerSink
/// <summary> /// <summary>
/// Absorbs power up to its capacity when anchored then explodes. /// Absorbs power up to its capacity when anchored then explodes.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class PowerSinkComponent : Component public sealed partial class PowerSinkComponent : Component
{ {
/// <summary> /// <summary>
@@ -21,6 +21,7 @@ namespace Content.Server.PowerSink
/// If explosion has been triggered, time at which to explode. /// If explosion has been triggered, time at which to explode.
/// </summary> /// </summary>
[DataField("explosionTime", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("explosionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public System.TimeSpan? ExplosionTime = null; public System.TimeSpan? ExplosionTime = null;
/// <summary> /// <summary>

View File

@@ -37,7 +37,6 @@ namespace Content.Server.PowerSink
base.Initialize(); base.Initialize();
SubscribeLocalEvent<PowerSinkComponent, ExaminedEvent>(OnExamine); SubscribeLocalEvent<PowerSinkComponent, ExaminedEvent>(OnExamine);
SubscribeLocalEvent<PowerSinkComponent, EntityUnpausedEvent>(OnUnpaused);
} }
private void OnExamine(EntityUid uid, PowerSinkComponent component, ExaminedEvent args) private void OnExamine(EntityUid uid, PowerSinkComponent component, ExaminedEvent args)
@@ -54,14 +53,6 @@ namespace Content.Server.PowerSink
); );
} }
private void OnUnpaused(EntityUid uid, PowerSinkComponent component, ref EntityUnpausedEvent args)
{
if (component.ExplosionTime == null)
return;
component.ExplosionTime = component.ExplosionTime + args.PausedTime;
}
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
var toRemove = new RemQueue<(EntityUid Entity, PowerSinkComponent Sink)>(); var toRemove = new RemQueue<(EntityUid Entity, PowerSinkComponent Sink)>();

View File

@@ -11,7 +11,7 @@ namespace Content.Server.Salvage.Expeditions;
/// <summary> /// <summary>
/// Designates this entity as holding a salvage expedition. /// Designates this entity as holding a salvage expedition.
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class SalvageExpeditionComponent : SharedSalvageExpeditionComponent public sealed partial class SalvageExpeditionComponent : SharedSalvageExpeditionComponent
{ {
public SalvageMissionParams MissionParams = default!; public SalvageMissionParams MissionParams = default!;
@@ -26,6 +26,7 @@ public sealed partial class SalvageExpeditionComponent : SharedSalvageExpedition
/// When the expeditions ends. /// When the expeditions ends.
/// </summary> /// </summary>
[ViewVariables(VVAccess.ReadWrite), DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [ViewVariables(VVAccess.ReadWrite), DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan EndTime; public TimeSpan EndTime;
/// <summary> /// <summary>

View File

@@ -31,10 +31,7 @@ public sealed partial class SalvageSystem
SubscribeLocalEvent<SalvageExpeditionConsoleComponent, EntParentChangedMessage>(OnSalvageConsoleParent); SubscribeLocalEvent<SalvageExpeditionConsoleComponent, EntParentChangedMessage>(OnSalvageConsoleParent);
SubscribeLocalEvent<SalvageExpeditionConsoleComponent, ClaimSalvageMessage>(OnSalvageClaimMessage); SubscribeLocalEvent<SalvageExpeditionConsoleComponent, ClaimSalvageMessage>(OnSalvageClaimMessage);
SubscribeLocalEvent<SalvageExpeditionDataComponent, EntityUnpausedEvent>(OnDataUnpaused);
SubscribeLocalEvent<SalvageExpeditionComponent, ComponentShutdown>(OnExpeditionShutdown); SubscribeLocalEvent<SalvageExpeditionComponent, ComponentShutdown>(OnExpeditionShutdown);
SubscribeLocalEvent<SalvageExpeditionComponent, EntityUnpausedEvent>(OnExpeditionUnpaused);
SubscribeLocalEvent<SalvageExpeditionComponent, ComponentGetState>(OnExpeditionGetState); SubscribeLocalEvent<SalvageExpeditionComponent, ComponentGetState>(OnExpeditionGetState);
SubscribeLocalEvent<SalvageStructureComponent, ExaminedEvent>(OnStructureExamine); SubscribeLocalEvent<SalvageStructureComponent, ExaminedEvent>(OnStructureExamine);
@@ -89,16 +86,6 @@ public sealed partial class SalvageSystem
} }
} }
private void OnDataUnpaused(EntityUid uid, SalvageExpeditionDataComponent component, ref EntityUnpausedEvent args)
{
component.NextOffer += args.PausedTime;
}
private void OnExpeditionUnpaused(EntityUid uid, SalvageExpeditionComponent component, ref EntityUnpausedEvent args)
{
component.EndTime += args.PausedTime;
}
private void UpdateExpeditions() private void UpdateExpeditions()
{ {
var currentTime = _timing.CurTime; var currentTime = _timing.CurTime;

View File

@@ -3,13 +3,14 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Shuttles.Components; namespace Content.Server.Shuttles.Components;
[RegisterComponent, Access(typeof(ArrivalsSystem))] [RegisterComponent, Access(typeof(ArrivalsSystem)), AutoGenerateComponentPause]
public sealed partial class ArrivalsShuttleComponent : Component public sealed partial class ArrivalsShuttleComponent : Component
{ {
[DataField("station")] [DataField("station")]
public EntityUid Station; public EntityUid Station;
[DataField("nextTransfer", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("nextTransfer", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextTransfer; public TimeSpan NextTransfer;
[DataField("nextArrivalsTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("nextArrivalsTime", customTypeSerializer: typeof(TimeOffsetSerializer))]

View File

@@ -6,9 +6,10 @@ namespace Content.Server.Shuttles.Components;
/// <summary> /// <summary>
/// If added to a grid gets launched when the emergency shuttle launches. /// If added to a grid gets launched when the emergency shuttle launches.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(EmergencyShuttleSystem))] [RegisterComponent, Access(typeof(EmergencyShuttleSystem)), AutoGenerateComponentPause]
public sealed partial class EscapePodComponent : Component public sealed partial class EscapePodComponent : Component
{ {
[DataField("launchTime", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("launchTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan? LaunchTime; public TimeSpan? LaunchTime;
} }

View File

@@ -85,7 +85,6 @@ public sealed class ArrivalsSystem : EntitySystem
SubscribeLocalEvent<StationArrivalsComponent, ComponentStartup>(OnArrivalsStartup); SubscribeLocalEvent<StationArrivalsComponent, ComponentStartup>(OnArrivalsStartup);
SubscribeLocalEvent<ArrivalsShuttleComponent, ComponentStartup>(OnShuttleStartup); SubscribeLocalEvent<ArrivalsShuttleComponent, ComponentStartup>(OnShuttleStartup);
SubscribeLocalEvent<ArrivalsShuttleComponent, EntityUnpausedEvent>(OnShuttleUnpaused);
SubscribeLocalEvent<ArrivalsShuttleComponent, FTLTagEvent>(OnShuttleTag); SubscribeLocalEvent<ArrivalsShuttleComponent, FTLTagEvent>(OnShuttleTag);
SubscribeLocalEvent<RoundStartingEvent>(OnRoundStarting); SubscribeLocalEvent<RoundStartingEvent>(OnRoundStarting);
@@ -384,11 +383,6 @@ public sealed class ArrivalsSystem : EntitySystem
EnsureComp<PreventPilotComponent>(uid); EnsureComp<PreventPilotComponent>(uid);
} }
private void OnShuttleUnpaused(EntityUid uid, ArrivalsShuttleComponent component, ref EntityUnpausedEvent args)
{
component.NextTransfer += args.PausedTime;
}
private bool TryGetArrivals(out EntityUid uid) private bool TryGetArrivals(out EntityUid uid)
{ {
var arrivalsQuery = EntityQueryEnumerator<ArrivalsSourceComponent>(); var arrivalsQuery = EntityQueryEnumerator<ArrivalsSourceComponent>();

View File

@@ -93,8 +93,6 @@ public sealed partial class EmergencyShuttleSystem
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealMessage>(OnEmergencyRepeal); SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealMessage>(OnEmergencyRepeal);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealAllMessage>(OnEmergencyRepealAll); SubscribeLocalEvent<EmergencyShuttleConsoleComponent, EmergencyShuttleRepealAllMessage>(OnEmergencyRepealAll);
SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnEmergencyOpenAttempt); SubscribeLocalEvent<EmergencyShuttleConsoleComponent, ActivatableUIOpenAttemptEvent>(OnEmergencyOpenAttempt);
SubscribeLocalEvent<EscapePodComponent, EntityUnpausedEvent>(OnEscapeUnpaused);
} }
private void OnEmergencyOpenAttempt(EntityUid uid, EmergencyShuttleConsoleComponent component, ActivatableUIOpenAttemptEvent args) private void OnEmergencyOpenAttempt(EntityUid uid, EmergencyShuttleConsoleComponent component, ActivatableUIOpenAttemptEvent args)

View File

@@ -507,14 +507,6 @@ public sealed partial class EmergencyShuttleSystem : EntitySystem
EnsureComp<EmergencyShuttleComponent>(shuttle.Value); EnsureComp<EmergencyShuttleComponent>(shuttle.Value);
} }
private void OnEscapeUnpaused(EntityUid uid, EscapePodComponent component, ref EntityUnpausedEvent args)
{
if (component.LaunchTime == null)
return;
component.LaunchTime = component.LaunchTime.Value + args.PausedTime;
}
/// <summary> /// <summary>
/// Returns whether a target is escaping on the emergency shuttle, but only if evac has arrived. /// Returns whether a target is escaping on the emergency shuttle, but only if evac has arrived.
/// </summary> /// </summary>

View File

@@ -40,7 +40,6 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
SubscribeLocalEvent<GhostComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume); SubscribeLocalEvent<GhostComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume);
SubscribeLocalEvent<StationDataComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume); SubscribeLocalEvent<StationDataComponent, EventHorizonAttemptConsumeEntityEvent>(PreventConsume);
SubscribeLocalEvent<EventHorizonComponent, MapInitEvent>(OnHorizonMapInit); SubscribeLocalEvent<EventHorizonComponent, MapInitEvent>(OnHorizonMapInit);
SubscribeLocalEvent<EventHorizonComponent, EntityUnpausedEvent>(OnHorizonUnpaused);
SubscribeLocalEvent<EventHorizonComponent, StartCollideEvent>(OnStartCollide); SubscribeLocalEvent<EventHorizonComponent, StartCollideEvent>(OnStartCollide);
SubscribeLocalEvent<EventHorizonComponent, EntGotInsertedIntoContainerMessage>(OnEventHorizonContained); SubscribeLocalEvent<EventHorizonComponent, EntGotInsertedIntoContainerMessage>(OnEventHorizonContained);
SubscribeLocalEvent<EventHorizonContainedEvent>(OnEventHorizonContained); SubscribeLocalEvent<EventHorizonContainedEvent>(OnEventHorizonContained);
@@ -57,11 +56,6 @@ public sealed class EventHorizonSystem : SharedEventHorizonSystem
component.NextConsumeWaveTime = _timing.CurTime; component.NextConsumeWaveTime = _timing.CurTime;
} }
private void OnHorizonUnpaused(EntityUid uid, EventHorizonComponent component, ref EntityUnpausedEvent args)
{
component.NextConsumeWaveTime += args.PausedTime;
}
public override void Shutdown() public override void Shutdown()
{ {
var vvHandle = Vvm.GetTypeHandler<EventHorizonComponent>(); var vvHandle = Vvm.GetTypeHandler<EventHorizonComponent>();

View File

@@ -2,12 +2,13 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Server.Spreader; namespace Content.Server.Spreader;
[RegisterComponent, Access(typeof(KudzuSystem))] [RegisterComponent, Access(typeof(KudzuSystem)), AutoGenerateComponentPause]
public sealed partial class GrowingKudzuComponent : Component public sealed partial class GrowingKudzuComponent : Component
{ {
/// <summary> /// <summary>
/// The next time kudzu will try to tick its growth level. /// The next time kudzu will try to tick its growth level.
/// </summary> /// </summary>
[DataField("nextTick", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("nextTick", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextTick = TimeSpan.Zero; public TimeSpan NextTick = TimeSpan.Zero;
} }

View File

@@ -21,7 +21,6 @@ public sealed class KudzuSystem : EntitySystem
{ {
SubscribeLocalEvent<KudzuComponent, ComponentStartup>(SetupKudzu); SubscribeLocalEvent<KudzuComponent, ComponentStartup>(SetupKudzu);
SubscribeLocalEvent<KudzuComponent, SpreadNeighborsEvent>(OnKudzuSpread); SubscribeLocalEvent<KudzuComponent, SpreadNeighborsEvent>(OnKudzuSpread);
SubscribeLocalEvent<GrowingKudzuComponent, EntityUnpausedEvent>(OnKudzuUnpaused);
SubscribeLocalEvent<KudzuComponent, DamageChangedEvent>(OnDamageChanged); SubscribeLocalEvent<KudzuComponent, DamageChangedEvent>(OnDamageChanged);
} }
@@ -80,11 +79,6 @@ public sealed class KudzuSystem : EntitySystem
} }
} }
private void OnKudzuUnpaused(EntityUid uid, GrowingKudzuComponent component, ref EntityUnpausedEvent args)
{
component.NextTick += args.PausedTime;
}
private void SetupKudzu(EntityUid uid, KudzuComponent component, ComponentStartup args) private void SetupKudzu(EntityUid uid, KudzuComponent component, ComponentStartup args)
{ {
if (!EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance)) if (!EntityManager.TryGetComponent<AppearanceComponent>(uid, out var appearance))

View File

@@ -6,7 +6,7 @@ namespace Content.Server.StationEvents.Components;
/// <summary> /// <summary>
/// Defines basic data for a station event /// Defines basic data for a station event
/// </summary> /// </summary>
[RegisterComponent] [RegisterComponent, AutoGenerateComponentPause]
public sealed partial class StationEventComponent : Component public sealed partial class StationEventComponent : Component
{ {
public const float WeightVeryLow = 0.0f; public const float WeightVeryLow = 0.0f;
@@ -79,11 +79,13 @@ public sealed partial class StationEventComponent : Component
/// When the station event starts. /// When the station event starts.
/// </summary> /// </summary>
[DataField("startTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("startTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan StartTime; public TimeSpan StartTime;
/// <summary> /// <summary>
/// When the station event ends. /// When the station event ends.
/// </summary> /// </summary>
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan? EndTime; public TimeSpan? EndTime;
} }

View File

@@ -29,15 +29,6 @@ public sealed class EventManagerSystem : EntitySystem
_sawmill = Logger.GetSawmill("events"); _sawmill = Logger.GetSawmill("events");
Subs.CVar(_configurationManager, CCVars.EventsEnabled, SetEnabled, true); Subs.CVar(_configurationManager, CCVars.EventsEnabled, SetEnabled, true);
SubscribeLocalEvent<StationEventComponent, EntityUnpausedEvent>(OnUnpaused);
}
private void OnUnpaused(EntityUid uid, StationEventComponent component, ref EntityUnpausedEvent args)
{
component.StartTime += args.PausedTime;
if (component.EndTime != null)
component.EndTime = component.EndTime.Value + args.PausedTime;
} }
/// <summary> /// <summary>

View File

@@ -6,7 +6,7 @@ namespace Content.Server.Tesla.Components;
/// <summary> /// <summary>
/// Periodically fires electric arcs at surrounding objects. /// Periodically fires electric arcs at surrounding objects.
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(LightningArcShooterSystem))] [RegisterComponent, Access(typeof(LightningArcShooterSystem)), AutoGenerateComponentPause]
public sealed partial class LightningArcShooterComponent : Component public sealed partial class LightningArcShooterComponent : Component
{ {
/// <summary> /// <summary>
@@ -45,6 +45,7 @@ public sealed partial class LightningArcShooterComponent : Component
/// The time, upon reaching which the next batch of lightning bolts will be fired. /// The time, upon reaching which the next batch of lightning bolts will be fired.
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField, ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextShootTime; public TimeSpan NextShootTime;
/// <summary> /// <summary>

View File

@@ -7,7 +7,7 @@ namespace Content.Server.Tesla.Components;
/// <summary> /// <summary>
/// The component changes the visual of an object after it is struck by lightning /// The component changes the visual of an object after it is struck by lightning
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(LightningSparkingSystem))] [RegisterComponent, Access(typeof(LightningSparkingSystem)), AutoGenerateComponentPause]
public sealed partial class LightningSparkingComponent : Component public sealed partial class LightningSparkingComponent : Component
{ {
/// <summary> /// <summary>
@@ -20,6 +20,7 @@ public sealed partial class LightningSparkingComponent : Component
/// When the spark visual should turn off. /// When the spark visual should turn off.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan LightningEndTime; public TimeSpan LightningEndTime;
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField, ViewVariables(VVAccess.ReadWrite)]

View File

@@ -18,7 +18,6 @@ public sealed class LightningArcShooterSystem : EntitySystem
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<LightningArcShooterComponent, MapInitEvent>(OnShooterMapInit); SubscribeLocalEvent<LightningArcShooterComponent, MapInitEvent>(OnShooterMapInit);
SubscribeLocalEvent<LightningArcShooterComponent, EntityUnpausedEvent>(OnShooterUnpaused);
} }
private void OnShooterMapInit(EntityUid uid, LightningArcShooterComponent component, ref MapInitEvent args) private void OnShooterMapInit(EntityUid uid, LightningArcShooterComponent component, ref MapInitEvent args)
@@ -26,11 +25,6 @@ public sealed class LightningArcShooterSystem : EntitySystem
component.NextShootTime = _gameTiming.CurTime + TimeSpan.FromSeconds(component.ShootMaxInterval); component.NextShootTime = _gameTiming.CurTime + TimeSpan.FromSeconds(component.ShootMaxInterval);
} }
private void OnShooterUnpaused(EntityUid uid, LightningArcShooterComponent component, ref EntityUnpausedEvent args)
{
component.NextShootTime += args.PausedTime;
}
public override void Update(float frameTime) public override void Update(float frameTime)
{ {
base.Update(frameTime); base.Update(frameTime);

View File

@@ -18,12 +18,6 @@ public sealed class LightningSparkingSystem : EntitySystem
base.Initialize(); base.Initialize();
SubscribeLocalEvent<LightningSparkingComponent, HitByLightningEvent>(OnHitByLightning); SubscribeLocalEvent<LightningSparkingComponent, HitByLightningEvent>(OnHitByLightning);
SubscribeLocalEvent<LightningSparkingComponent, EntityUnpausedEvent>(OnLightningUnpaused);
}
private void OnLightningUnpaused(EntityUid uid, LightningSparkingComponent component, ref EntityUnpausedEvent args)
{
component.LightningEndTime += args.PausedTime;
} }
private void OnHitByLightning(Entity<LightningSparkingComponent> uid, ref HitByLightningEvent args) private void OnHitByLightning(Entity<LightningSparkingComponent> uid, ref HitByLightningEvent args)

View File

@@ -14,7 +14,7 @@ namespace Content.Shared.Anomaly.Components;
/// ///
/// Anomalies and their related components were designed here: https://hackmd.io/@ss14-design/r1sQbkJOs /// Anomalies and their related components were designed here: https://hackmd.io/@ss14-design/r1sQbkJOs
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(SharedAnomalySystem))] [Access(typeof(SharedAnomalySystem))]
public sealed partial class AnomalyComponent : Component public sealed partial class AnomalyComponent : Component
{ {
@@ -86,7 +86,7 @@ public sealed partial class AnomalyComponent : Component
/// <summary> /// <summary>
/// The time at which the next artifact pulse will occur. /// The time at which the next artifact pulse will occur.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField, AutoPausedField]
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
public TimeSpan NextPulseTime = TimeSpan.Zero; public TimeSpan NextPulseTime = TimeSpan.Zero;

View File

@@ -5,13 +5,14 @@ namespace Content.Shared.Anomaly.Components;
/// <summary> /// <summary>
/// This component tracks anomalies that are currently pulsing /// This component tracks anomalies that are currently pulsing
/// </summary> /// </summary>
[RegisterComponent, Access(typeof(SharedAnomalySystem))] [RegisterComponent, Access(typeof(SharedAnomalySystem)), AutoGenerateComponentPause]
public sealed partial class AnomalyPulsingComponent : Component public sealed partial class AnomalyPulsingComponent : Component
{ {
/// <summary> /// <summary>
/// The time at which the pulse will be over. /// The time at which the pulse will be over.
/// </summary> /// </summary>
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan EndTime; public TimeSpan EndTime;
/// <summary> /// <summary>

View File

@@ -8,6 +8,7 @@ namespace Content.Shared.Anomaly.Components;
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState]
[Access(typeof(SharedAnomalySystem))] [Access(typeof(SharedAnomalySystem))]
[AutoGenerateComponentPause]
public sealed partial class AnomalySupercriticalComponent : Component public sealed partial class AnomalySupercriticalComponent : Component
{ {
/// <summary> /// <summary>
@@ -15,6 +16,7 @@ public sealed partial class AnomalySupercriticalComponent : Component
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan EndTime; public TimeSpan EndTime;
/// <summary> /// <summary>

View File

@@ -46,10 +46,6 @@ public abstract class SharedAnomalySystem : EntitySystem
SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitStartEvent>(OnAnomalyThrowStart); SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitStartEvent>(OnAnomalyThrowStart);
SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitEndEvent>(OnAnomalyThrowEnd); SubscribeLocalEvent<AnomalyComponent, MeleeThrowOnHitEndEvent>(OnAnomalyThrowEnd);
SubscribeLocalEvent<AnomalyComponent, EntityUnpausedEvent>(OnAnomalyUnpause);
SubscribeLocalEvent<AnomalyPulsingComponent, EntityUnpausedEvent>(OnPulsingUnpause);
SubscribeLocalEvent<AnomalySupercriticalComponent, EntityUnpausedEvent>(OnSupercriticalUnpause);
_sawmill = Logger.GetSawmill("anomaly"); _sawmill = Logger.GetSawmill("anomaly");
} }
@@ -89,23 +85,6 @@ public abstract class SharedAnomalySystem : EntitySystem
Popup.PopupEntity(Loc.GetString("anomaly-component-contact-damage"), target, target); Popup.PopupEntity(Loc.GetString("anomaly-component-contact-damage"), target, target);
} }
private void OnAnomalyUnpause(EntityUid uid, AnomalyComponent component, ref EntityUnpausedEvent args)
{
component.NextPulseTime += args.PausedTime;
Dirty(uid, component);
}
private void OnPulsingUnpause(EntityUid uid, AnomalyPulsingComponent component, ref EntityUnpausedEvent args)
{
component.EndTime += args.PausedTime;
}
private void OnSupercriticalUnpause(EntityUid uid, AnomalySupercriticalComponent component, ref EntityUnpausedEvent args)
{
component.EndTime += args.PausedTime;
Dirty(uid, component);
}
public void DoAnomalyPulse(EntityUid uid, AnomalyComponent? component = null) public void DoAnomalyPulse(EntityUid uid, AnomalyComponent? component = null)
{ {
if (!Resolve(uid, ref component)) if (!Resolve(uid, ref component))

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Atmos.Rotting;
/// This makes mobs eventually start rotting when they die. /// This makes mobs eventually start rotting when they die.
/// It may be expanded to food at some point, but it's just for mobs right now. /// It may be expanded to food at some point, but it's just for mobs right now.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(SharedRottingSystem))] [Access(typeof(SharedRottingSystem))]
public sealed partial class PerishableComponent : Component public sealed partial class PerishableComponent : Component
{ {
@@ -27,6 +27,7 @@ public sealed partial class PerishableComponent : Component
/// Gasses are released, this is when the next gas release update will be. /// Gasses are released, this is when the next gas release update will be.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan RotNextUpdate = TimeSpan.Zero; public TimeSpan RotNextUpdate = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -8,7 +8,7 @@ namespace Content.Shared.Atmos.Rotting;
/// Tracking component for stuff that has started to rot. /// Tracking component for stuff that has started to rot.
/// Only the current stage is networked to the client. /// Only the current stage is networked to the client.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
[Access(typeof(SharedRottingSystem))] [Access(typeof(SharedRottingSystem))]
public sealed partial class RottingComponent : Component public sealed partial class RottingComponent : Component
{ {
@@ -22,6 +22,7 @@ public sealed partial class RottingComponent : Component
/// When the next check will happen for rot progression + effects like damage and ammonia /// When the next check will happen for rot progression + effects like damage and ammonia
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextRotUpdate = TimeSpan.Zero; public TimeSpan NextRotUpdate = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -8,7 +8,7 @@ namespace Content.Shared.Bed.Cryostorage;
/// This is used to track an entity that is currently being held in Cryostorage. /// This is used to track an entity that is currently being held in Cryostorage.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState] [AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class CryostorageContainedComponent : Component public sealed partial class CryostorageContainedComponent : Component
{ {
/// <summary> /// <summary>
@@ -22,6 +22,7 @@ public sealed partial class CryostorageContainedComponent : Component
/// The time at which the cryostorage grace period ends. /// The time at which the cryostorage grace period ends.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite), AutoNetworkedField]
[AutoPausedField]
public TimeSpan? GracePeriodEndTime; public TimeSpan? GracePeriodEndTime;
/// <summary> /// <summary>

View File

@@ -37,7 +37,6 @@ public abstract class SharedCryostorageSystem : EntitySystem
SubscribeLocalEvent<CryostorageComponent, CanDropTargetEvent>(OnCanDropTarget); SubscribeLocalEvent<CryostorageComponent, CanDropTargetEvent>(OnCanDropTarget);
SubscribeLocalEvent<CryostorageContainedComponent, EntGotRemovedFromContainerMessage>(OnRemovedContained); SubscribeLocalEvent<CryostorageContainedComponent, EntGotRemovedFromContainerMessage>(OnRemovedContained);
SubscribeLocalEvent<CryostorageContainedComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<CryostorageContainedComponent, ComponentShutdown>(OnShutdownContained); SubscribeLocalEvent<CryostorageContainedComponent, ComponentShutdown>(OnShutdownContained);
SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart); SubscribeLocalEvent<RoundRestartCleanupEvent>(OnRoundRestart);
@@ -130,13 +129,6 @@ public abstract class SharedCryostorageSystem : EntitySystem
RemCompDeferred(ent, comp); RemCompDeferred(ent, comp);
} }
private void OnUnpaused(Entity<CryostorageContainedComponent> ent, ref EntityUnpausedEvent args)
{
var comp = ent.Comp;
if (comp.GracePeriodEndTime != null)
comp.GracePeriodEndTime = comp.GracePeriodEndTime.Value + args.PausedTime;
}
private void OnShutdownContained(Entity<CryostorageContainedComponent> ent, ref ComponentShutdown args) private void OnShutdownContained(Entity<CryostorageContainedComponent> ent, ref ComponentShutdown args)
{ {
var comp = ent.Comp; var comp = ent.Comp;

View File

@@ -26,14 +26,8 @@ namespace Content.Server.Bed.Sleep
SubscribeLocalEvent<SleepingComponent, SpeakAttemptEvent>(OnSpeakAttempt); SubscribeLocalEvent<SleepingComponent, SpeakAttemptEvent>(OnSpeakAttempt);
SubscribeLocalEvent<SleepingComponent, CanSeeAttemptEvent>(OnSeeAttempt); SubscribeLocalEvent<SleepingComponent, CanSeeAttemptEvent>(OnSeeAttempt);
SubscribeLocalEvent<SleepingComponent, PointAttemptEvent>(OnPointAttempt); SubscribeLocalEvent<SleepingComponent, PointAttemptEvent>(OnPointAttempt);
SubscribeLocalEvent<SleepingComponent, EntityUnpausedEvent>(OnSleepUnpaused);
} }
private void OnSleepUnpaused(EntityUid uid, SleepingComponent component, ref EntityUnpausedEvent args)
{
component.CoolDownEnd += args.PausedTime;
Dirty(uid, component);
}
private void OnMapInit(EntityUid uid, SleepingComponent component, MapInitEvent args) private void OnMapInit(EntityUid uid, SleepingComponent component, MapInitEvent args)
{ {

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Bed.Sleep;
/// <summary> /// <summary>
/// Added to entities when they go to sleep. /// Added to entities when they go to sleep.
/// </summary> /// </summary>
[NetworkedComponent, RegisterComponent] [NetworkedComponent, RegisterComponent, AutoGenerateComponentPause(Dirty = true)]
public sealed partial class SleepingComponent : Component public sealed partial class SleepingComponent : Component
{ {
/// <summary> /// <summary>
@@ -24,6 +24,7 @@ public sealed partial class SleepingComponent : Component
public TimeSpan Cooldown = TimeSpan.FromSeconds(1f); public TimeSpan Cooldown = TimeSpan.FromSeconds(1f);
[DataField("cooldownEnd", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("cooldownEnd", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan CoolDownEnd; public TimeSpan CoolDownEnd;
[DataField("wakeAction")] public EntityUid? WakeAction; [DataField("wakeAction")] public EntityUid? WakeAction;

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Chasm;
/// <summary> /// <summary>
/// Added to entities which have started falling into a chasm. /// Added to entities which have started falling into a chasm.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
public sealed partial class ChasmFallingComponent : Component public sealed partial class ChasmFallingComponent : Component
{ {
/// <summary> /// <summary>
@@ -23,6 +23,7 @@ public sealed partial class ChasmFallingComponent : Component
public TimeSpan DeletionTime = TimeSpan.FromSeconds(1.8f); public TimeSpan DeletionTime = TimeSpan.FromSeconds(1.8f);
[DataField("nextDeletionTime", customTypeSerializer:typeof(TimeOffsetSerializer))] [DataField("nextDeletionTime", customTypeSerializer:typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextDeletionTime = TimeSpan.Zero; public TimeSpan NextDeletionTime = TimeSpan.Zero;
/// <summary> /// <summary>

View File

@@ -26,7 +26,6 @@ public sealed class ChasmSystem : EntitySystem
SubscribeLocalEvent<ChasmComponent, StepTriggeredEvent>(OnStepTriggered); SubscribeLocalEvent<ChasmComponent, StepTriggeredEvent>(OnStepTriggered);
SubscribeLocalEvent<ChasmComponent, StepTriggerAttemptEvent>(OnStepTriggerAttempt); SubscribeLocalEvent<ChasmComponent, StepTriggerAttemptEvent>(OnStepTriggerAttempt);
SubscribeLocalEvent<ChasmFallingComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<ChasmFallingComponent, UpdateCanMoveEvent>(OnUpdateCanMove); SubscribeLocalEvent<ChasmFallingComponent, UpdateCanMoveEvent>(OnUpdateCanMove);
} }
@@ -73,11 +72,6 @@ public sealed class ChasmSystem : EntitySystem
args.Continue = true; args.Continue = true;
} }
private void OnUnpaused(EntityUid uid, ChasmFallingComponent component, ref EntityUnpausedEvent args)
{
component.NextDeletionTime += args.PausedTime;
}
private void OnUpdateCanMove(EntityUid uid, ChasmFallingComponent component, UpdateCanMoveEvent args) private void OnUpdateCanMove(EntityUid uid, ChasmFallingComponent component, UpdateCanMoveEvent args)
{ {
args.Cancel(); args.Cancel();

View File

@@ -7,13 +7,14 @@ namespace Content.Shared.Chemistry.Components;
/// This is used for entities which are currently being affected by smoke. /// This is used for entities which are currently being affected by smoke.
/// Manages the gradual metabolism every second. /// Manages the gradual metabolism every second.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
public sealed partial class SmokeAffectedComponent : Component public sealed partial class SmokeAffectedComponent : Component
{ {
/// <summary> /// <summary>
/// The time at which the next smoke metabolism will occur. /// The time at which the next smoke metabolism will occur.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextSecond; public TimeSpan NextSecond;
/// <summary> /// <summary>

View File

@@ -4,7 +4,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Climbing.Components; namespace Content.Shared.Climbing.Components;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class ClimbingComponent : Component public sealed partial class ClimbingComponent : Component
{ {
/// <summary> /// <summary>
@@ -17,6 +17,7 @@ public sealed partial class ClimbingComponent : Component
/// Whether the owner is being moved onto the climbed entity. /// Whether the owner is being moved onto the climbed entity.
/// </summary> /// </summary>
[AutoNetworkedField, DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [AutoNetworkedField, DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan? NextTransition; public TimeSpan? NextTransition;
/// <summary> /// <summary>

View File

@@ -62,7 +62,6 @@ public sealed partial class ClimbSystem : VirtualController
SubscribeLocalEvent<ClimbingComponent, ClimbDoAfterEvent>(OnDoAfter); SubscribeLocalEvent<ClimbingComponent, ClimbDoAfterEvent>(OnDoAfter);
SubscribeLocalEvent<ClimbingComponent, EndCollideEvent>(OnClimbEndCollide); SubscribeLocalEvent<ClimbingComponent, EndCollideEvent>(OnClimbEndCollide);
SubscribeLocalEvent<ClimbingComponent, BuckleChangeEvent>(OnBuckleChange); SubscribeLocalEvent<ClimbingComponent, BuckleChangeEvent>(OnBuckleChange);
SubscribeLocalEvent<ClimbingComponent, EntityUnpausedEvent>(OnClimbableUnpaused);
SubscribeLocalEvent<ClimbableComponent, CanDropTargetEvent>(OnCanDragDropOn); SubscribeLocalEvent<ClimbableComponent, CanDropTargetEvent>(OnCanDragDropOn);
SubscribeLocalEvent<ClimbableComponent, GetVerbsEvent<AlternativeVerb>>(AddClimbableVerb); SubscribeLocalEvent<ClimbableComponent, GetVerbsEvent<AlternativeVerb>>(AddClimbableVerb);
@@ -71,15 +70,6 @@ public sealed partial class ClimbSystem : VirtualController
SubscribeLocalEvent<GlassTableComponent, ClimbedOnEvent>(OnGlassClimbed); SubscribeLocalEvent<GlassTableComponent, ClimbedOnEvent>(OnGlassClimbed);
} }
private void OnClimbableUnpaused(EntityUid uid, ClimbingComponent component, ref EntityUnpausedEvent args)
{
if (component.NextTransition == null)
return;
component.NextTransition = component.NextTransition.Value + args.PausedTime;
Dirty(uid, component);
}
public override void UpdateBeforeSolve(bool prediction, float frameTime) public override void UpdateBeforeSolve(bool prediction, float frameTime)
{ {
base.UpdateBeforeSolve(prediction, frameTime); base.UpdateBeforeSolve(prediction, frameTime);

View File

@@ -28,16 +28,9 @@ public sealed class PacificationSystem : EntitySystem
SubscribeLocalEvent<PacifiedComponent, BeforeThrowEvent>(OnBeforeThrow); SubscribeLocalEvent<PacifiedComponent, BeforeThrowEvent>(OnBeforeThrow);
SubscribeLocalEvent<PacifiedComponent, AttackAttemptEvent>(OnAttackAttempt); SubscribeLocalEvent<PacifiedComponent, AttackAttemptEvent>(OnAttackAttempt);
SubscribeLocalEvent<PacifiedComponent, ShotAttemptedEvent>(OnShootAttempt); SubscribeLocalEvent<PacifiedComponent, ShotAttemptedEvent>(OnShootAttempt);
SubscribeLocalEvent<PacifiedComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<PacifismDangerousAttackComponent, AttemptPacifiedAttackEvent>(OnPacifiedDangerousAttack); SubscribeLocalEvent<PacifismDangerousAttackComponent, AttemptPacifiedAttackEvent>(OnPacifiedDangerousAttack);
} }
private void OnUnpaused(Entity<PacifiedComponent> ent, ref EntityUnpausedEvent args)
{
if (ent.Comp.NextPopupTime != null)
ent.Comp.NextPopupTime = ent.Comp.NextPopupTime.Value + args.PausedTime;
}
private bool PacifiedCanAttack(EntityUid user, EntityUid target, [NotNullWhen(false)] out string? reason) private bool PacifiedCanAttack(EntityUid user, EntityUid target, [NotNullWhen(false)] out string? reason)
{ {
var ev = new AttemptPacifiedAttackEvent(user); var ev = new AttemptPacifiedAttackEvent(user);

View File

@@ -11,7 +11,7 @@ namespace Content.Shared.CombatMode.Pacification;
/// ///
/// If you want full-pacifism (no combat mode at all), you can simply set <see cref="DisallowAllCombat"/> before adding. /// If you want full-pacifism (no combat mode at all), you can simply set <see cref="DisallowAllCombat"/> before adding.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
[Access(typeof(PacificationSystem))] [Access(typeof(PacificationSystem))]
public sealed partial class PacifiedComponent : Component public sealed partial class PacifiedComponent : Component
{ {
@@ -33,6 +33,7 @@ public sealed partial class PacifiedComponent : Component
public TimeSpan PopupCooldown = TimeSpan.FromSeconds(3.0); public TimeSpan PopupCooldown = TimeSpan.FromSeconds(3.0);
[DataField] [DataField]
[AutoPausedField]
public TimeSpan? NextPopupTime = null; public TimeSpan? NextPopupTime = null;
/// <summary> /// <summary>

View File

@@ -11,7 +11,7 @@ namespace Content.Shared.Construction.Components;
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
[Access(typeof(SharedFlatpackSystem))] [Access(typeof(SharedFlatpackSystem))]
[AutoGenerateComponentState] [AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class FlatpackCreatorComponent : Component public sealed partial class FlatpackCreatorComponent : Component
{ {
/// <summary> /// <summary>
@@ -26,6 +26,7 @@ public sealed partial class FlatpackCreatorComponent : Component
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField] [AutoNetworkedField]
[AutoPausedField]
public TimeSpan PackEndTime; public TimeSpan PackEndTime;
/// <summary> /// <summary>

View File

@@ -40,7 +40,6 @@ public abstract class SharedFlatpackSystem : EntitySystem
SubscribeLocalEvent<FlatpackComponent, ExaminedEvent>(OnFlatpackExamined); SubscribeLocalEvent<FlatpackComponent, ExaminedEvent>(OnFlatpackExamined);
SubscribeLocalEvent<FlatpackCreatorComponent, ContainerIsRemovingAttemptEvent>(OnCreatorRemovingAttempt); SubscribeLocalEvent<FlatpackCreatorComponent, ContainerIsRemovingAttemptEvent>(OnCreatorRemovingAttempt);
SubscribeLocalEvent<FlatpackCreatorComponent, EntityUnpausedEvent>(OnCreatorUnpaused);
} }
private void OnFlatpackInteractUsing(Entity<FlatpackComponent> ent, ref InteractUsingEvent args) private void OnFlatpackInteractUsing(Entity<FlatpackComponent> ent, ref InteractUsingEvent args)
@@ -110,11 +109,6 @@ public abstract class SharedFlatpackSystem : EntitySystem
args.Cancel(); args.Cancel();
} }
private void OnCreatorUnpaused(Entity<FlatpackCreatorComponent> ent, ref EntityUnpausedEvent args)
{
ent.Comp.PackEndTime += args.PausedTime;
}
public void SetupFlatpack(Entity<FlatpackComponent?> ent, EntityUid? board) public void SetupFlatpack(Entity<FlatpackComponent?> ent, EntityUid? board)
{ {
if (!Resolve(ent, ref ent.Comp)) if (!Resolve(ent, ref ent.Comp))

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Damage.Components; namespace Content.Shared.Damage.Components;
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent]
[AutoGenerateComponentState] [AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(DamageOnHoldingSystem))] [Access(typeof(DamageOnHoldingSystem))]
public sealed partial class DamageOnHoldingComponent : Component public sealed partial class DamageOnHoldingComponent : Component
{ {
@@ -29,5 +29,6 @@ public sealed partial class DamageOnHoldingComponent : Component
[DataField("nextDamage", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("nextDamage", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoNetworkedField] [AutoNetworkedField]
[AutoPausedField]
public TimeSpan NextDamage = TimeSpan.Zero; public TimeSpan NextDamage = TimeSpan.Zero;
} }

View File

@@ -6,7 +6,7 @@ namespace Content.Shared.Damage.Components;
/// <summary> /// <summary>
/// Add to an entity to paralyze it whenever it reaches critical amounts of Stamina DamageType. /// Add to an entity to paralyze it whenever it reaches critical amounts of Stamina DamageType.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true)] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState(true), AutoGenerateComponentPause]
public sealed partial class StaminaComponent : Component public sealed partial class StaminaComponent : Component
{ {
/// <summary> /// <summary>
@@ -49,5 +49,6 @@ public sealed partial class StaminaComponent : Component
/// To avoid continuously updating our data we track the last time we updated so we can extrapolate our current stamina. /// To avoid continuously updating our data we track the last time we updated so we can extrapolate our current stamina.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
[AutoPausedField]
public TimeSpan NextUpdate = TimeSpan.Zero; public TimeSpan NextUpdate = TimeSpan.Zero;
} }

View File

@@ -13,7 +13,6 @@ public sealed class DamageOnHoldingSystem : EntitySystem
public override void Initialize() public override void Initialize()
{ {
base.Initialize(); base.Initialize();
SubscribeLocalEvent<DamageOnHoldingComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<DamageOnHoldingComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<DamageOnHoldingComponent, MapInitEvent>(OnMapInit);
} }
@@ -26,11 +25,6 @@ public sealed class DamageOnHoldingSystem : EntitySystem
} }
} }
private void OnUnpaused(EntityUid uid, DamageOnHoldingComponent component, ref EntityUnpausedEvent args)
{
component.NextDamage += args.PausedTime;
}
private void OnMapInit(EntityUid uid, DamageOnHoldingComponent component, MapInitEvent args) private void OnMapInit(EntityUid uid, DamageOnHoldingComponent component, MapInitEvent args)
{ {
component.NextDamage = _timing.CurTime; component.NextDamage = _timing.CurTime;
@@ -50,4 +44,4 @@ public sealed class DamageOnHoldingSystem : EntitySystem
component.NextDamage = _timing.CurTime + TimeSpan.FromSeconds(component.Interval); component.NextDamage = _timing.CurTime + TimeSpan.FromSeconds(component.Interval);
} }
} }
} }

View File

@@ -46,7 +46,6 @@ public sealed partial class StaminaSystem : EntitySystem
InitializeModifier(); InitializeModifier();
SubscribeLocalEvent<StaminaComponent, EntityUnpausedEvent>(OnStamUnpaused);
SubscribeLocalEvent<StaminaComponent, ComponentStartup>(OnStartup); SubscribeLocalEvent<StaminaComponent, ComponentStartup>(OnStartup);
SubscribeLocalEvent<StaminaComponent, ComponentShutdown>(OnShutdown); SubscribeLocalEvent<StaminaComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<StaminaComponent, AfterAutoHandleStateEvent>(OnStamHandleState); SubscribeLocalEvent<StaminaComponent, AfterAutoHandleStateEvent>(OnStamHandleState);
@@ -61,11 +60,6 @@ public sealed partial class StaminaSystem : EntitySystem
SubscribeLocalEvent<StaminaDamageOnHitComponent, MeleeHitEvent>(OnMeleeHit); SubscribeLocalEvent<StaminaDamageOnHitComponent, MeleeHitEvent>(OnMeleeHit);
} }
private void OnStamUnpaused(EntityUid uid, StaminaComponent component, ref EntityUnpausedEvent args)
{
component.NextUpdate += args.PausedTime;
}
private void OnStamHandleState(EntityUid uid, StaminaComponent component, ref AfterAutoHandleStateEvent args) private void OnStamHandleState(EntityUid uid, StaminaComponent component, ref AfterAutoHandleStateEvent args)
{ {
if (component.Critical) if (component.Critical)

View File

@@ -7,7 +7,7 @@ namespace Content.Shared.Emp;
/// While entity has this component it is "disabled" by EMP. /// While entity has this component it is "disabled" by EMP.
/// Add desired behaviour in other systems /// Add desired behaviour in other systems
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
[Access(typeof(SharedEmpSystem))] [Access(typeof(SharedEmpSystem))]
public sealed partial class EmpDisabledComponent : Component public sealed partial class EmpDisabledComponent : Component
{ {
@@ -15,6 +15,7 @@ public sealed partial class EmpDisabledComponent : Component
/// Moment of time when component is removed and entity stops being "disabled" /// Moment of time when component is removed and entity stops being "disabled"
/// </summary> /// </summary>
[DataField("timeLeft", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("timeLeft", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan DisabledUntil; public TimeSpan DisabledUntil;
[DataField("effectCoolDown"), ViewVariables(VVAccess.ReadWrite)] [DataField("effectCoolDown"), ViewVariables(VVAccess.ReadWrite)]
@@ -23,5 +24,6 @@ public sealed partial class EmpDisabledComponent : Component
/// <summary> /// <summary>
/// When next effect will be spawned /// When next effect will be spawned
/// </summary> /// </summary>
[AutoPausedField]
public TimeSpan TargetTime = TimeSpan.Zero; public TimeSpan TargetTime = TimeSpan.Zero;
} }

View File

@@ -6,12 +6,13 @@ namespace Content.Shared.Gravity;
/// <summary> /// <summary>
/// Indicates this entity is shaking due to gravity changes. /// Indicates this entity is shaking due to gravity changes.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class GravityShakeComponent : Component public sealed partial class GravityShakeComponent : Component
{ {
[ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField] [ViewVariables(VVAccess.ReadWrite), DataField, AutoNetworkedField]
public int ShakeTimes; public int ShakeTimes;
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
[AutoPausedField]
public TimeSpan NextShake; public TimeSpan NextShake;
} }

View File

@@ -5,16 +5,6 @@ public abstract partial class SharedGravitySystem
protected const float GravityKick = 100.0f; protected const float GravityKick = 100.0f;
protected const float ShakeCooldown = 0.2f; protected const float ShakeCooldown = 0.2f;
private void InitializeShake()
{
SubscribeLocalEvent<GravityShakeComponent, EntityUnpausedEvent>(OnShakeUnpaused);
}
private void OnShakeUnpaused(EntityUid uid, GravityShakeComponent component, ref EntityUnpausedEvent args)
{
component.NextShake += args.PausedTime;
}
private void UpdateShake() private void UpdateShake()
{ {
var curTime = Timing.CurTime; var curTime = Timing.CurTime;

View File

@@ -61,8 +61,6 @@ namespace Content.Shared.Gravity
SubscribeLocalEvent<GravityChangedEvent>(OnGravityChange); SubscribeLocalEvent<GravityChangedEvent>(OnGravityChange);
SubscribeLocalEvent<GravityComponent, ComponentGetState>(OnGetState); SubscribeLocalEvent<GravityComponent, ComponentGetState>(OnGetState);
SubscribeLocalEvent<GravityComponent, ComponentHandleState>(OnHandleState); SubscribeLocalEvent<GravityComponent, ComponentHandleState>(OnHandleState);
InitializeShake();
} }
public override void Update(float frameTime) public override void Update(float frameTime)

View File

@@ -5,7 +5,7 @@ using Robust.Shared.Serialization;
namespace Content.Shared.Hands.Components; namespace Content.Shared.Hands.Components;
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
[Access(typeof(SharedHandsSystem))] [Access(typeof(SharedHandsSystem))]
public sealed partial class HandsComponent : Component public sealed partial class HandsComponent : Component
{ {
@@ -62,6 +62,7 @@ public sealed partial class HandsComponent : Component
/// The time at which throws will be allowed again. /// The time at which throws will be allowed again.
/// </summary> /// </summary>
[DataField, ViewVariables(VVAccess.ReadWrite)] [DataField, ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan NextThrowTime; public TimeSpan NextThrowTime;
/// <summary> /// <summary>

View File

@@ -8,7 +8,7 @@ namespace Content.Shared.Materials;
/// Tracker component for the process of reclaiming entities /// Tracker component for the process of reclaiming entities
/// <seealso cref="MaterialReclaimerComponent"/> /// <seealso cref="MaterialReclaimerComponent"/>
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedMaterialReclaimerSystem))] [RegisterComponent, NetworkedComponent, Access(typeof(SharedMaterialReclaimerSystem)), AutoGenerateComponentPause]
public sealed partial class ActiveMaterialReclaimerComponent : Component public sealed partial class ActiveMaterialReclaimerComponent : Component
{ {
/// <summary> /// <summary>
@@ -21,6 +21,7 @@ public sealed partial class ActiveMaterialReclaimerComponent : Component
/// When the reclaiming process ends. /// When the reclaiming process ends.
/// </summary> /// </summary>
[DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("endTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan EndTime; public TimeSpan EndTime;
/// <summary> /// <summary>

View File

@@ -3,7 +3,7 @@ using Robust.Shared.Serialization.TypeSerializers.Implementations.Custom;
namespace Content.Shared.Materials; namespace Content.Shared.Materials;
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
public sealed partial class InsertingMaterialStorageComponent : Component public sealed partial class InsertingMaterialStorageComponent : Component
{ {
/// <summary> /// <summary>
@@ -11,6 +11,7 @@ public sealed partial class InsertingMaterialStorageComponent : Component
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer)), AutoNetworkedField]
[ViewVariables(VVAccess.ReadWrite)] [ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan EndTime; public TimeSpan EndTime;
[ViewVariables, AutoNetworkedField] [ViewVariables, AutoNetworkedField]

View File

@@ -10,7 +10,7 @@ namespace Content.Shared.Materials;
/// This is a machine that handles converting entities /// This is a machine that handles converting entities
/// into the raw materials and chemicals that make them up. /// into the raw materials and chemicals that make them up.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, AutoGenerateComponentState, AutoGenerateComponentPause]
[Access(typeof(SharedMaterialReclaimerSystem))] [Access(typeof(SharedMaterialReclaimerSystem))]
public sealed partial class MaterialReclaimerComponent : Component public sealed partial class MaterialReclaimerComponent : Component
{ {
@@ -90,6 +90,7 @@ public sealed partial class MaterialReclaimerComponent : Component
/// When the next sound will be allowed to be played. Used to prevent spam. /// When the next sound will be allowed to be played. Used to prevent spam.
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan NextSound; public TimeSpan NextSound;
/// <summary> /// <summary>

View File

@@ -34,13 +34,11 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
public override void Initialize() public override void Initialize()
{ {
SubscribeLocalEvent<MaterialReclaimerComponent, ComponentShutdown>(OnShutdown); SubscribeLocalEvent<MaterialReclaimerComponent, ComponentShutdown>(OnShutdown);
SubscribeLocalEvent<MaterialReclaimerComponent, EntityUnpausedEvent>(OnUnpaused);
SubscribeLocalEvent<MaterialReclaimerComponent, ExaminedEvent>(OnExamined); SubscribeLocalEvent<MaterialReclaimerComponent, ExaminedEvent>(OnExamined);
SubscribeLocalEvent<MaterialReclaimerComponent, GotEmaggedEvent>(OnEmagged); SubscribeLocalEvent<MaterialReclaimerComponent, GotEmaggedEvent>(OnEmagged);
SubscribeLocalEvent<MaterialReclaimerComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<MaterialReclaimerComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<CollideMaterialReclaimerComponent, StartCollideEvent>(OnCollide); SubscribeLocalEvent<CollideMaterialReclaimerComponent, StartCollideEvent>(OnCollide);
SubscribeLocalEvent<ActiveMaterialReclaimerComponent, ComponentStartup>(OnActiveStartup); SubscribeLocalEvent<ActiveMaterialReclaimerComponent, ComponentStartup>(OnActiveStartup);
SubscribeLocalEvent<ActiveMaterialReclaimerComponent, EntityUnpausedEvent>(OnActiveUnpaused);
} }
private void OnMapInit(EntityUid uid, MaterialReclaimerComponent component, MapInitEvent args) private void OnMapInit(EntityUid uid, MaterialReclaimerComponent component, MapInitEvent args)
@@ -53,11 +51,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
_audio.Stop(component.Stream); _audio.Stop(component.Stream);
} }
private void OnUnpaused(EntityUid uid, MaterialReclaimerComponent component, ref EntityUnpausedEvent args)
{
component.NextSound += args.PausedTime;
}
private void OnExamined(EntityUid uid, MaterialReclaimerComponent component, ExaminedEvent args) private void OnExamined(EntityUid uid, MaterialReclaimerComponent component, ExaminedEvent args)
{ {
args.PushMarkup(Loc.GetString("recycler-count-items", ("items", component.ItemsProcessed))); args.PushMarkup(Loc.GetString("recycler-count-items", ("items", component.ItemsProcessed)));
@@ -82,11 +75,6 @@ public abstract class SharedMaterialReclaimerSystem : EntitySystem
component.ReclaimingContainer = Container.EnsureContainer<Container>(uid, ActiveReclaimerContainerId); component.ReclaimingContainer = Container.EnsureContainer<Container>(uid, ActiveReclaimerContainerId);
} }
private void OnActiveUnpaused(EntityUid uid, ActiveMaterialReclaimerComponent component, ref EntityUnpausedEvent args)
{
component.EndTime += args.PausedTime;
}
/// <summary> /// <summary>
/// Tries to start processing an item via a <see cref="MaterialReclaimerComponent"/>. /// Tries to start processing an item via a <see cref="MaterialReclaimerComponent"/>.
/// </summary> /// </summary>

View File

@@ -30,7 +30,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
SubscribeLocalEvent<MaterialStorageComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<MaterialStorageComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<MaterialStorageComponent, InteractUsingEvent>(OnInteractUsing); SubscribeLocalEvent<MaterialStorageComponent, InteractUsingEvent>(OnInteractUsing);
SubscribeLocalEvent<InsertingMaterialStorageComponent, EntityUnpausedEvent>(OnUnpaused);
} }
public override void Update(float frameTime) public override void Update(float frameTime)
@@ -52,11 +51,6 @@ public abstract class SharedMaterialStorageSystem : EntitySystem
_appearance.SetData(uid, MaterialStorageVisuals.Inserting, false); _appearance.SetData(uid, MaterialStorageVisuals.Inserting, false);
} }
private void OnUnpaused(EntityUid uid, InsertingMaterialStorageComponent component, ref EntityUnpausedEvent args)
{
component.EndTime += args.PausedTime;
}
/// <summary> /// <summary>
/// Gets the volume of a specified material contained in this storage. /// Gets the volume of a specified material contained in this storage.
/// </summary> /// </summary>

View File

@@ -11,7 +11,7 @@ namespace Content.Shared.Medical;
/// This is used for defibrillators; a machine that shocks a dead /// This is used for defibrillators; a machine that shocks a dead
/// person back into the world of the living. /// person back into the world of the living.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent] [RegisterComponent, NetworkedComponent, AutoGenerateComponentPause]
public sealed partial class DefibrillatorComponent : Component public sealed partial class DefibrillatorComponent : Component
{ {
/// <summary> /// <summary>
@@ -24,6 +24,7 @@ public sealed partial class DefibrillatorComponent : Component
/// The time at which the zap cooldown will be completed /// The time at which the zap cooldown will be completed
/// </summary> /// </summary>
[DataField("nextZapTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)] [DataField("nextZapTime", customTypeSerializer: typeof(TimeOffsetSerializer)), ViewVariables(VVAccess.ReadWrite)]
[AutoPausedField]
public TimeSpan? NextZapTime; public TimeSpan? NextZapTime;
/// <summary> /// <summary>

View File

@@ -15,6 +15,7 @@ namespace Content.Shared.Ninja.Components;
/// As an implementation detail, dashing with katana is a suit action which isn't ideal. /// As an implementation detail, dashing with katana is a suit action which isn't ideal.
/// </summary> /// </summary>
[RegisterComponent, NetworkedComponent, Access(typeof(SharedNinjaSuitSystem)), AutoGenerateComponentState] [RegisterComponent, NetworkedComponent, Access(typeof(SharedNinjaSuitSystem)), AutoGenerateComponentState]
[AutoGenerateComponentPause]
public sealed partial class NinjaSuitComponent : Component public sealed partial class NinjaSuitComponent : Component
{ {
/// <summary> /// <summary>
@@ -46,6 +47,7 @@ public sealed partial class NinjaSuitComponent : Component
/// Time at which we will be able to use our abilities again /// Time at which we will be able to use our abilities again
/// </summary> /// </summary>
[DataField(customTypeSerializer: typeof(TimeOffsetSerializer))] [DataField(customTypeSerializer: typeof(TimeOffsetSerializer))]
[AutoPausedField]
public TimeSpan DisableCooldown; public TimeSpan DisableCooldown;
/// <summary> /// <summary>

View File

@@ -27,7 +27,6 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
base.Initialize(); base.Initialize();
SubscribeLocalEvent<NinjaSuitComponent, MapInitEvent>(OnMapInit); SubscribeLocalEvent<NinjaSuitComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<NinjaSuitComponent, EntityUnpausedEvent>(OnEntityUnpaused);
SubscribeLocalEvent<NinjaSuitComponent, GotEquippedEvent>(OnEquipped); SubscribeLocalEvent<NinjaSuitComponent, GotEquippedEvent>(OnEquipped);
SubscribeLocalEvent<NinjaSuitComponent, GetItemActionsEvent>(OnGetItemActions); SubscribeLocalEvent<NinjaSuitComponent, GetItemActionsEvent>(OnGetItemActions);
@@ -43,11 +42,6 @@ public abstract class SharedNinjaSuitSystem : EntitySystem
Dirty(uid, component); Dirty(uid, component);
} }
private void OnEntityUnpaused(Entity<NinjaSuitComponent> ent, ref EntityUnpausedEvent args)
{
ent.Comp.DisableCooldown += args.PausedTime;
}
/// <summary> /// <summary>
/// Call the shared and serverside code for when a ninja equips the suit. /// Call the shared and serverside code for when a ninja equips the suit.
/// </summary> /// </summary>

Some files were not shown because too many files have changed in this diff Show More