mirror of
https://github.com/WWhiteDreamProject/wwdpublic.git
synced 2026-04-21 23:48:15 +03:00
23 lines
608 B
C#
23 lines
608 B
C#
using Robust.Client.UserInterface.CustomControls;
|
|
|
|
namespace Content.Client._White.UserInterface.Buttons;
|
|
|
|
public sealed class WhiteUICommandButton : WhiteCommandButton
|
|
{
|
|
public Type? WindowType { get; set; }
|
|
private DefaultWindow? _window;
|
|
|
|
protected override void Execute(ButtonEventArgs obj)
|
|
{
|
|
if (WindowType == null)
|
|
return;
|
|
|
|
var windowInstance = IoCManager.Resolve<IDynamicTypeFactory>().CreateInstance(WindowType);
|
|
if (windowInstance is not DefaultWindow window)
|
|
return;
|
|
|
|
_window = window;
|
|
_window.OpenCentered();
|
|
}
|
|
}
|