Gas Analyzer can now scan pipes/devices along with the environment (#10976)
This commit is contained in:
@@ -6,29 +6,60 @@ namespace Content.Shared.Atmos.Components
|
||||
[NetworkedComponent()]
|
||||
public abstract class SharedGasAnalyzerComponent : Component
|
||||
{
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum GasAnalyzerUiKey
|
||||
{
|
||||
Key,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Atmospheric data is gathered in the system and sent to the user
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class GasAnalyzerBoundUserInterfaceState : BoundUserInterfaceState
|
||||
public sealed class GasAnalyzerUserMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public float Pressure;
|
||||
public float Temperature;
|
||||
public GasEntry[]? Gases;
|
||||
public string DeviceName;
|
||||
public EntityUid DeviceUid;
|
||||
public bool DeviceFlipped;
|
||||
public string? Error;
|
||||
|
||||
public GasAnalyzerBoundUserInterfaceState(float pressure, float temperature, GasEntry[]? gases, string? error = null)
|
||||
public GasMixEntry[] NodeGasMixes;
|
||||
public GasAnalyzerUserMessage(GasMixEntry[] nodeGasMixes, string deviceName, EntityUid deviceUid, bool deviceFlipped, string? error = null)
|
||||
{
|
||||
Pressure = pressure;
|
||||
Temperature = temperature;
|
||||
Gases = gases;
|
||||
NodeGasMixes = nodeGasMixes;
|
||||
DeviceName = deviceName;
|
||||
DeviceUid = deviceUid;
|
||||
DeviceFlipped = deviceFlipped;
|
||||
Error = error;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains information on a gas mix entry, turns into a tab in the UI
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public struct GasMixEntry
|
||||
{
|
||||
/// <summary>
|
||||
/// Name of the tab in the UI
|
||||
/// </summary>
|
||||
public readonly string Name;
|
||||
public readonly float Pressure;
|
||||
public readonly float Temperature;
|
||||
public readonly GasEntry[]? Gases;
|
||||
|
||||
public GasMixEntry(string name, float pressure, float temperature, GasEntry[]? gases = null)
|
||||
{
|
||||
Name = name;
|
||||
Pressure = pressure;
|
||||
Temperature = temperature;
|
||||
Gases = gases;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Individual gas entry data for populating the UI
|
||||
/// </summary>
|
||||
[Serializable, NetSerializable]
|
||||
public struct GasEntry
|
||||
{
|
||||
@@ -54,43 +85,15 @@ namespace Content.Shared.Atmos.Components
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class GasAnalyzerRefreshMessage : BoundUserInterfaceMessage
|
||||
public sealed class GasAnalyzerDisableMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public GasAnalyzerRefreshMessage() {}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public enum GasAnalyzerDanger
|
||||
{
|
||||
Nominal,
|
||||
Warning,
|
||||
Hazard
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public sealed class GasAnalyzerComponentState : ComponentState
|
||||
{
|
||||
public GasAnalyzerDanger Danger;
|
||||
|
||||
public GasAnalyzerComponentState(GasAnalyzerDanger danger)
|
||||
{
|
||||
Danger = danger;
|
||||
}
|
||||
public GasAnalyzerDisableMessage() {}
|
||||
}
|
||||
}
|
||||
|
||||
[NetSerializable]
|
||||
[Serializable]
|
||||
public enum GasAnalyzerVisuals
|
||||
[Serializable, NetSerializable]
|
||||
public enum GasAnalyzerVisuals : byte
|
||||
{
|
||||
VisualState,
|
||||
}
|
||||
|
||||
[NetSerializable]
|
||||
[Serializable]
|
||||
public enum GasAnalyzerVisualState
|
||||
{
|
||||
Off,
|
||||
Working,
|
||||
Enabled,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user