GhostRoleRadioBoundUserInterface.cs 845 B

1234567891011121314151617181920212223242526272829
  1. using Content.Shared.Ghost.Roles;
  2. using Robust.Client.UserInterface;
  3. using Robust.Shared.Prototypes;
  4. namespace Content.Client.Ghost;
  5. public sealed class GhostRoleRadioBoundUserInterface : BoundUserInterface
  6. {
  7. private GhostRoleRadioMenu? _ghostRoleRadioMenu;
  8. public GhostRoleRadioBoundUserInterface(EntityUid owner, Enum uiKey) : base(owner, uiKey)
  9. {
  10. IoCManager.InjectDependencies(this);
  11. }
  12. protected override void Open()
  13. {
  14. base.Open();
  15. _ghostRoleRadioMenu = this.CreateWindow<GhostRoleRadioMenu>();
  16. _ghostRoleRadioMenu.SetEntity(Owner);
  17. _ghostRoleRadioMenu.SendGhostRoleRadioMessageAction += SendGhostRoleRadioMessage;
  18. }
  19. private void SendGhostRoleRadioMessage(ProtoId<GhostRolePrototype> protoId)
  20. {
  21. SendMessage(new GhostRoleRadioMessage(protoId));
  22. }
  23. }