2021-07-17 02:37:09 +02:00
|
|
|
|
using System;
|
2021-02-17 09:39:31 -03:00
|
|
|
|
using Robust.Client.UserInterface.CustomControls;
|
|
|
|
|
|
using Robust.Shared.IoC;
|
|
|
|
|
|
|
2021-06-09 22:19:39 +02:00
|
|
|
|
namespace Content.Client.Administration.UI.CustomControls
|
2021-02-17 09:39:31 -03:00
|
|
|
|
{
|
|
|
|
|
|
public class UICommandButton : CommandButton
|
|
|
|
|
|
{
|
|
|
|
|
|
public Type? WindowType { get; set; }
|
|
|
|
|
|
private SS14Window? _window;
|
|
|
|
|
|
|
|
|
|
|
|
protected override void Execute(ButtonEventArgs obj)
|
|
|
|
|
|
{
|
|
|
|
|
|
if (WindowType == null)
|
|
|
|
|
|
return;
|
|
|
|
|
|
_window = (SS14Window) IoCManager.Resolve<IDynamicTypeFactory>().CreateInstance(WindowType);
|
|
|
|
|
|
_window?.OpenCentered();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|