Improve gas analyzer interface (#22779)
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System.Linq;
|
||||
using Content.Server.Atmos;
|
||||
using Content.Server.Atmos.Components;
|
||||
using Content.Server.NodeContainer;
|
||||
@@ -23,6 +24,11 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
[Dependency] private readonly UserInterfaceSystem _userInterface = default!;
|
||||
[Dependency] private readonly TransformSystem _transform = default!;
|
||||
|
||||
/// <summary>
|
||||
/// Minimum moles of a gas to be sent to the client.
|
||||
/// </summary>
|
||||
private const float UIMinMoles = 0.01f;
|
||||
|
||||
public override void Initialize()
|
||||
{
|
||||
base.Initialize();
|
||||
@@ -254,7 +260,7 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
{
|
||||
var gas = _atmo.GetGas(i);
|
||||
|
||||
if (mixture?.Moles[i] <= Atmospherics.GasMinMoles)
|
||||
if (mixture?.Moles[i] <= UIMinMoles)
|
||||
continue;
|
||||
|
||||
if (mixture != null)
|
||||
@@ -264,7 +270,9 @@ namespace Content.Server.Atmos.EntitySystems
|
||||
}
|
||||
}
|
||||
|
||||
return gases.ToArray();
|
||||
var gasesOrdered = gases.OrderByDescending(gas => gas.Amount);
|
||||
|
||||
return gasesOrdered.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user