CVars for atmos (#2633)
* Monstermos is a word! * Atmos CVars * Cache CVars in AtmosphereSystem. Co-authored-by: Pieter-Jan Briers <pieterjan.briers+git@gmail.com>
This commit is contained in:
committed by
GitHub
parent
8177be3061
commit
6bb1e9fa5d
@@ -5,6 +5,7 @@ using System.Linq;
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.Atmos.Reactions;
|
||||
using Content.Server.GameObjects.Components.Atmos;
|
||||
using Content.Shared;
|
||||
using Content.Shared.Atmos;
|
||||
using Content.Shared.GameObjects.EntitySystems.Atmos;
|
||||
using Content.Shared.Maps;
|
||||
@@ -15,6 +16,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameObjects.Components.Map;
|
||||
using Robust.Shared.GameObjects.Components.Transform;
|
||||
using Robust.Shared.GameObjects.Systems;
|
||||
using Robust.Shared.Interfaces.Configuration;
|
||||
using Robust.Shared.Interfaces.GameObjects;
|
||||
using Robust.Shared.Interfaces.Map;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -30,6 +32,7 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
[Dependency] private readonly IPrototypeManager _protoMan = default!;
|
||||
[Dependency] private readonly IMapManager _mapManager = default!;
|
||||
[Dependency] private readonly IPauseManager _pauseManager = default!;
|
||||
[Dependency] private readonly IConfigurationManager _cfg = default!;
|
||||
|
||||
private GasReactionPrototype[] _gasReactions = Array.Empty<GasReactionPrototype>();
|
||||
|
||||
@@ -68,6 +71,43 @@ namespace Content.Server.GameObjects.EntitySystems
|
||||
|
||||
// Required for airtight components.
|
||||
EntityManager.EventBus.SubscribeEvent<RotateEvent>(EventSource.Local, this, RotateEvent);
|
||||
|
||||
_cfg.OnValueChanged(CCVars.SpaceWind, OnSpaceWindChanged, true);
|
||||
_cfg.OnValueChanged(CCVars.MonstermosEqualization, OnMonstermosEqualizationChanged, true);
|
||||
_cfg.OnValueChanged(CCVars.AtmosMaxProcessTime, OnAtmosMaxProcessTimeChanged, true);
|
||||
_cfg.OnValueChanged(CCVars.AtmosTickRate, OnAtmosTickRateChanged, true);
|
||||
_cfg.OnValueChanged(CCVars.ExcitedGroupsSpaceIsAllConsuming, OnExcitedGroupsSpaceIsAllConsumingChanged, true);
|
||||
}
|
||||
|
||||
public bool SpaceWind { get; private set; }
|
||||
public bool MonstermosEqualization { get; private set; }
|
||||
public bool ExcitedGroupsSpaceIsAllConsuming { get; private set; }
|
||||
public float AtmosMaxProcessTime { get; private set; }
|
||||
public float AtmosTickRate { get; private set; }
|
||||
|
||||
private void OnExcitedGroupsSpaceIsAllConsumingChanged(bool obj)
|
||||
{
|
||||
ExcitedGroupsSpaceIsAllConsuming = obj;
|
||||
}
|
||||
|
||||
private void OnAtmosTickRateChanged(float obj)
|
||||
{
|
||||
AtmosTickRate = obj;
|
||||
}
|
||||
|
||||
private void OnAtmosMaxProcessTimeChanged(float obj)
|
||||
{
|
||||
AtmosMaxProcessTime = obj;
|
||||
}
|
||||
|
||||
private void OnMonstermosEqualizationChanged(bool obj)
|
||||
{
|
||||
MonstermosEqualization = obj;
|
||||
}
|
||||
|
||||
private void OnSpaceWindChanged(bool obj)
|
||||
{
|
||||
SpaceWind = obj;
|
||||
}
|
||||
|
||||
public override void Shutdown()
|
||||
|
||||
Reference in New Issue
Block a user