Remove some BUI boilerplate (#28399)
* Remove some BUI boilerplate - The disposals overrides got removed due to the helper method handling it. - Replace window creation with CreateWindow helper. - Fixed some stinky code which would cause exceptions. * More * moar * weh * done * More BUIs * More updates * weh * moar * look who it is * weh * merge * weh * fixes
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
using Content.Shared.Bed.Cryostorage;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.UserInterface;
|
||||
|
||||
namespace Content.Client.Bed.Cryostorage;
|
||||
|
||||
@@ -17,9 +18,7 @@ public sealed class CryostorageBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_menu = new();
|
||||
|
||||
_menu.OnClose += Close;
|
||||
_menu = this.CreateWindow<CryostorageMenu>();
|
||||
|
||||
_menu.SlotRemoveButtonPressed += (ent, slot) =>
|
||||
{
|
||||
@@ -30,8 +29,6 @@ public sealed class CryostorageBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
SendMessage(new CryostorageRemoveItemBuiMessage(ent, hand, CryostorageRemoveItemBuiMessage.RemovalType.Hand));
|
||||
};
|
||||
|
||||
_menu.OpenCentered();
|
||||
}
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
@@ -45,12 +42,4 @@ public sealed class CryostorageBoundUserInterface : BoundUserInterface
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (!disposing)
|
||||
return;
|
||||
_menu?.Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user