Health analyzer displays turns off when the battery dies (#16125)

This commit is contained in:
Vasilis
2023-05-13 18:28:11 +02:00
committed by GitHub
parent 407d8c3c8b
commit 4f8d4f89d6
7 changed files with 26 additions and 5 deletions

View File

@@ -8,6 +8,7 @@ namespace Content.Shared.PowerCell;
public abstract class SharedPowerCellSystem : EntitySystem
{
[Dependency] private readonly ItemSlotsSystem _itemSlots = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
public override void Initialize()
{
@@ -48,7 +49,7 @@ public abstract class SharedPowerCellSystem : EntitySystem
if (args.Container.ID != component.CellSlotId)
return;
_appearance.SetData(uid, PowerCellSlotVisuals.Enabled, true);
RaiseLocalEvent(uid, new PowerCellChangedEvent(false), false);
}
@@ -56,7 +57,7 @@ public abstract class SharedPowerCellSystem : EntitySystem
{
if (args.Container.ID != component.CellSlotId)
return;
_appearance.SetData(uid, PowerCellSlotVisuals.Enabled, false);
RaiseLocalEvent(uid, new PowerCellChangedEvent(true), false);
}
}