Atmos Debug Overlay expansion (#2626)
* Atmos Debug Overlay: Add a way of showing blocked directions * Atmos Debug Overlay: Adjustable modes client-side * Atmos Debug Overlay: Fix atvrange help text * Atmos Debug Overlay: More flexible and clear gas ID specification
This commit is contained in:
28
Content.Shared/Atmos/AtmosCommandUtils.cs
Normal file
28
Content.Shared/Atmos/AtmosCommandUtils.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
#nullable enable
|
||||
using System;
|
||||
using Content.Shared.Atmos;
|
||||
|
||||
namespace Content.Shared.Atmos
|
||||
{
|
||||
public class AtmosCommandUtils
|
||||
{
|
||||
/// <summary>
|
||||
/// Gas ID parser for atmospherics commands.
|
||||
/// This is so there's a central place for this logic for if the Gas enum gets removed.
|
||||
/// </summary>
|
||||
public static bool TryParseGasID(string str, out int x)
|
||||
{
|
||||
x = -1;
|
||||
if (Enum.TryParse<Gas>(str, true, out var gas))
|
||||
{
|
||||
x = (int) gas;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!int.TryParse(str, out x))
|
||||
return false;
|
||||
}
|
||||
return ((x >= 0) && (x < Atmospherics.TotalNumberOfGases));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -23,13 +23,15 @@ namespace Content.Shared.GameObjects.EntitySystems.Atmos
|
||||
public readonly float[] Moles;
|
||||
public readonly AtmosDirection PressureDirection;
|
||||
public readonly bool InExcitedGroup;
|
||||
public readonly AtmosDirection BlockDirection;
|
||||
|
||||
public AtmosDebugOverlayData(float temperature, float[] moles, AtmosDirection pressureDirection, bool inExcited)
|
||||
public AtmosDebugOverlayData(float temperature, float[] moles, AtmosDirection pressureDirection, bool inExcited, AtmosDirection blockDirection)
|
||||
{
|
||||
Temperature = temperature;
|
||||
Moles = moles;
|
||||
PressureDirection = pressureDirection;
|
||||
InExcitedGroup = inExcited;
|
||||
BlockDirection = blockDirection;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user