mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 10:21:18 +03:00
* Make every EntitySystem partial * Oobs thats for a diff PR * Also oops on that one * Test systems * git are we fr * Update file templates * cleanup empty classes while we are here * forgor --------- Co-authored-by: AJCM-git <ajcm_mail@disroot.org>
39 lines
1.2 KiB
C#
39 lines
1.2 KiB
C#
using Content.Client.Atmos.UI;
|
|
using Content.Client.Items;
|
|
using Content.Shared.Atmos.Components;
|
|
using Content.Shared.Atmos.EntitySystems;
|
|
|
|
namespace Content.Client.Atmos.EntitySystems;
|
|
|
|
public sealed partial class GasTankSystem : SharedGasTankSystem
|
|
{
|
|
public override void Initialize()
|
|
{
|
|
base.Initialize();
|
|
SubscribeLocalEvent<GasTankComponent, AfterAutoHandleStateEvent>(OnGasTankState);
|
|
|
|
Subs.ItemStatus<GasTankComponent>(entity => new TankPressureStatusControl(entity));
|
|
}
|
|
|
|
protected override void DeviceUpdated(Entity<GasTankComponent> entity, ref AtmosDeviceUpdateEvent args)
|
|
{
|
|
// Atmos not predicted :(
|
|
throw new NotImplementedException();
|
|
}
|
|
|
|
private void OnGasTankState(Entity<GasTankComponent> ent, ref AfterAutoHandleStateEvent args)
|
|
{
|
|
if (UI.TryGetOpenUi(ent.Owner, SharedGasTankUiKey.Key, out var bui))
|
|
{
|
|
bui.Update<GasTankBoundUserInterfaceState>();
|
|
}
|
|
}
|
|
|
|
public override void UpdateUserInterface(Entity<GasTankComponent> ent)
|
|
{
|
|
if (UI.TryGetOpenUi(ent.Owner, SharedGasTankUiKey.Key, out var bui))
|
|
{
|
|
bui.Update<GasTankBoundUserInterfaceState>();
|
|
}
|
|
}
|
|
}
|