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,12 +1,13 @@
|
||||
using Content.Shared.VoiceMask;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface;
|
||||
using Robust.Shared.Prototypes;
|
||||
|
||||
namespace Content.Client.VoiceMask;
|
||||
|
||||
public sealed class VoiceMaskBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
[Dependency] private readonly IPrototypeManager _proto = default!;
|
||||
[Dependency] private readonly IPrototypeManager _protomanager = default!;
|
||||
|
||||
[ViewVariables]
|
||||
private VoiceMaskNameChangeWindow? _window;
|
||||
@@ -19,12 +20,11 @@ public sealed class VoiceMaskBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
base.Open();
|
||||
|
||||
_window = new(_proto);
|
||||
_window = this.CreateWindow<VoiceMaskNameChangeWindow>();
|
||||
_window.ReloadVerbs(_protomanager);
|
||||
|
||||
_window.OpenCentered();
|
||||
_window.OnNameChange += OnNameSelected;
|
||||
_window.OnVerbChange += verb => SendMessage(new VoiceMaskChangeVerbMessage(verb));
|
||||
_window.OnClose += Close;
|
||||
}
|
||||
|
||||
private void OnNameSelected(string name)
|
||||
|
||||
Reference in New Issue
Block a user