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:
ike709
2021-11-02 04:44:40 -05:00
committed by GitHub
parent 025a930c08
commit 9da98e3916
8 changed files with 363 additions and 0 deletions

View File

@@ -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;
}
}
}