1
0

UICommandButton.cs 596 B

1234567891011121314151617181920
  1. using System;
  2. using Robust.Client.UserInterface.CustomControls;
  3. using Robust.Shared.IoC;
  4. namespace Content.Client.Administration.UI.CustomControls
  5. {
  6. public sealed class UICommandButton : CommandButton
  7. {
  8. public Type? WindowType { get; set; }
  9. private DefaultWindow? _window;
  10. protected override void Execute(ButtonEventArgs obj)
  11. {
  12. if (WindowType == null)
  13. return;
  14. _window = (DefaultWindow) IoCManager.Resolve<IDynamicTypeFactory>().CreateInstance(WindowType);
  15. _window?.OpenCentered();
  16. }
  17. }
  18. }