mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-09-15 06:42:25 +02:00
Add CreateWindowCenteredRight method (#5666)
This commit is contained in:
@@ -51,6 +51,22 @@ public static class BoundUserInterfaceExt
|
||||
return window;
|
||||
}
|
||||
|
||||
public static T CreateWindowCenteredRight<T>(this BoundUserInterface bui) where T : BaseWindow, new()
|
||||
{
|
||||
var window = GetWindow<T>(bui);
|
||||
|
||||
if (bui.EntMan.System<UserInterfaceSystem>().TryGetPosition(bui.Owner, bui.UiKey, out var position))
|
||||
{
|
||||
window.Open(position);
|
||||
}
|
||||
else
|
||||
{
|
||||
window.OpenCenteredRight();
|
||||
}
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a control for this BUI that will be disposed when it is disposed.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user