GeigerSystem.cs 685 B

123456789101112131415161718192021
  1. using Content.Client.Items;
  2. using Content.Client.Radiation.UI;
  3. using Content.Shared.Radiation.Components;
  4. using Content.Shared.Radiation.Systems;
  5. namespace Content.Client.Radiation.Systems;
  6. public sealed class GeigerSystem : SharedGeigerSystem
  7. {
  8. public override void Initialize()
  9. {
  10. base.Initialize();
  11. SubscribeLocalEvent<GeigerComponent, AfterAutoHandleStateEvent>(OnHandleState);
  12. Subs.ItemStatus<GeigerComponent>(ent => ent.Comp.ShowControl ? new GeigerItemControl(ent) : null);
  13. }
  14. private void OnHandleState(EntityUid uid, GeigerComponent component, ref AfterAutoHandleStateEvent args)
  15. {
  16. component.UiUpdateNeeded = true;
  17. }
  18. }