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:
@@ -24,14 +24,13 @@ namespace Content.Client.PDA
|
||||
|
||||
if (_menu == null)
|
||||
CreateMenu();
|
||||
|
||||
_menu?.OpenCenteredLeft();
|
||||
}
|
||||
|
||||
private void CreateMenu()
|
||||
{
|
||||
_menu = new PdaMenu();
|
||||
_menu.OnClose += Close;
|
||||
_menu = this.CreateWindow<PdaMenu>();
|
||||
_menu.OpenCenteredLeft();
|
||||
|
||||
_menu.FlashLightToggleButton.OnToggled += _ =>
|
||||
{
|
||||
SendMessage(new PdaToggleFlashlightMessage());
|
||||
@@ -96,7 +95,6 @@ namespace Content.Client.PDA
|
||||
_menu?.UpdateState(updateState);
|
||||
}
|
||||
|
||||
|
||||
protected override void AttachCartridgeUI(Control cartridgeUIFragment, string? title)
|
||||
{
|
||||
_menu?.ProgramView.AddChild(cartridgeUIFragment);
|
||||
@@ -118,15 +116,6 @@ namespace Content.Client.PDA
|
||||
_menu?.UpdateAvailablePrograms(programs);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
if (!disposing)
|
||||
return;
|
||||
|
||||
_menu?.Dispose();
|
||||
}
|
||||
|
||||
private PdaBorderColorComponent? GetBorderColorComponent()
|
||||
{
|
||||
return EntMan.GetComponentOrNull<PdaBorderColorComponent>(Owner);
|
||||
|
||||
Reference in New Issue
Block a user