DeimplantBoundUserInterface.cs 934 B

1234567891011121314151617181920212223242526272829303132333435
  1. using Content.Shared.Implants;
  2. using Robust.Client.UserInterface;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Client.Implants.UI;
  5. public sealed class DeimplantBoundUserInterface : BoundUserInterface
  6. {
  7. [Dependency] private readonly IPrototypeManager _protomanager = default!;
  8. [ViewVariables]
  9. private DeimplantChoiceWindow? _window;
  10. public DeimplantBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
  11. {
  12. }
  13. protected override void Open()
  14. {
  15. base.Open();
  16. _window = this.CreateWindow<DeimplantChoiceWindow>();
  17. _window.OnImplantChange += implant => SendMessage(new DeimplantChangeVerbMessage(implant));
  18. }
  19. public void UpdateState(Dictionary<string, string> implantList, string? implant)
  20. {
  21. if (_window != null)
  22. {
  23. _window.UpdateImplantList(implantList);
  24. _window.UpdateState(implant);
  25. }
  26. }
  27. }