mirror of
https://github.com/space-syndicate/space-station-14.git
synced 2026-10-09 18:31:17 +03:00
* more-item-status * update 1 * update 2 * Update pistol.yml * update 3 * yml * oops * BatteryItemStatus * fix ChargeItemStatus * Update item-status.ftl * review update 1 * review fix 1 * Update BatteryInfoSystem.cs * Update TimerTriggerItemStatus * merge fix * merge fix * review update 2 * review update 3 * fix marge * StyleNano * review update 4 * review update 5 * BatteryItemStatus * BatteryItemStatus Client * code cleanup * merge * merge and GasTank fix * Merge * unnecessary components * review * oops * GasTank * wawa
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 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>();
|
|
}
|
|
}
|
|
}
|