CatStation/Content.Client/Atmos/EntitySystems/GasTankSystem.cs
Pok e7897d76a4
More item status (#39264)
* 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
2026-07-19 23:41:09 +00:00

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>();
}
}
}