Files
OldThink/Content.Client/Administration/UI/CustomControls/UICommandButton.cs

21 lines
596 B
C#
Raw Normal View History

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