Adds a UI for gas filters (#5052)
* Adds a UI for gas filters * Address reviews * Update Content.Client/Atmos/UI/GasFilterBoundUserInterface.cs * Update Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs * Fix build Co-authored-by: ike709 <ike709@github.com> Co-authored-by: Vera Aguilera Puerto <6766154+Zumorica@users.noreply.github.com> Co-authored-by: Vera Aguilera Puerto <gradientvera@outlook.com>
This commit is contained in:
@@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.Serialization;
|
||||
|
||||
namespace Content.Shared.Atmos.Piping.Trinary.Components
|
||||
{
|
||||
[Serializable, NetSerializable]
|
||||
public enum GasFilterUiKey
|
||||
{
|
||||
Key,
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class GasFilterBoundUserInterfaceState : BoundUserInterfaceState
|
||||
{
|
||||
public string FilterLabel { get; }
|
||||
public float TransferRate { get; }
|
||||
public bool Enabled { get; }
|
||||
public Gas? FilteredGas { get; }
|
||||
|
||||
public GasFilterBoundUserInterfaceState(string filterLabel, float transferRate, bool enabled, Gas? filteredGas)
|
||||
{
|
||||
FilterLabel = filterLabel;
|
||||
TransferRate = transferRate;
|
||||
Enabled = enabled;
|
||||
FilteredGas = filteredGas;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class GasFilterToggleStatusMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public bool Enabled { get; }
|
||||
|
||||
public GasFilterToggleStatusMessage(bool enabled)
|
||||
{
|
||||
Enabled = enabled;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class GasFilterChangeRateMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public float Rate { get; }
|
||||
|
||||
public GasFilterChangeRateMessage(float rate)
|
||||
{
|
||||
Rate = rate;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable, NetSerializable]
|
||||
public class GasFilterSelectGasMessage : BoundUserInterfaceMessage
|
||||
{
|
||||
public int ID { get; }
|
||||
|
||||
public GasFilterSelectGasMessage(int id)
|
||||
{
|
||||
ID = id;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user