diff --git a/Robust.Client/UserInterface/BoundUserInterfaceExt.cs b/Robust.Client/UserInterface/BoundUserInterfaceExt.cs index 54a2b635fe1..9cea88e7481 100644 --- a/Robust.Client/UserInterface/BoundUserInterfaceExt.cs +++ b/Robust.Client/UserInterface/BoundUserInterfaceExt.cs @@ -51,6 +51,22 @@ public static class BoundUserInterfaceExt return window; } + public static T CreateWindowCenteredRight(this BoundUserInterface bui) where T : BaseWindow, new() + { + var window = GetWindow(bui); + + if (bui.EntMan.System().TryGetPosition(bui.Owner, bui.UiKey, out var position)) + { + window.Open(position); + } + else + { + window.OpenCenteredRight(); + } + + return window; + } + /// /// Creates a control for this BUI that will be disposed when it is disposed. ///