Add window helper for BUIs (#5183)

* Add window helper for BUIs

Automatically does OnClose and just makes content slightly nicer.

* more

* Add prototype reload helper

* Add Box2i Center

* weh
This commit is contained in:
metalgearsloth
2024-07-20 14:50:15 +10:00
committed by GitHub
parent 2664061993
commit 176ca6c578
5 changed files with 137 additions and 42 deletions

View File

@@ -1,4 +1,5 @@
using System;
using System.Numerics;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Robust.Shared.Utility;
@@ -22,6 +23,7 @@ namespace Robust.Shared.Maths
public readonly int Width => Math.Abs(Right - Left);
public readonly int Height => Math.Abs(Top - Bottom);
public readonly Vector2i Size => new(Width, Height);
public readonly Vector2 Center => TopRight - BottomLeft / 2;
public UIBox2i(Vector2i topLeft, Vector2i bottomRight)
{