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:
@@ -11,7 +11,8 @@ namespace Content.Client.NukeOps;
|
||||
[GenerateTypedNameReferences]
|
||||
public sealed partial class WarDeclaratorWindow : FancyWindow
|
||||
{
|
||||
private readonly IGameTiming _gameTiming;
|
||||
[Dependency] private readonly IGameTiming _gameTiming = default!;
|
||||
[Dependency] private readonly ILocalizationManager _localizationManager = default!;
|
||||
|
||||
public event Action<string>? OnActivated;
|
||||
|
||||
@@ -19,15 +20,13 @@ public sealed partial class WarDeclaratorWindow : FancyWindow
|
||||
private TimeSpan _shuttleDisabledTime;
|
||||
private WarConditionStatus _status;
|
||||
|
||||
public WarDeclaratorWindow(IGameTiming gameTiming, ILocalizationManager localizationManager)
|
||||
public WarDeclaratorWindow()
|
||||
{
|
||||
RobustXamlLoader.Load(this);
|
||||
|
||||
_gameTiming = gameTiming;
|
||||
|
||||
WarButton.OnPressed += (_) => OnActivated?.Invoke(Rope.Collapse(MessageEdit.TextRope));
|
||||
|
||||
MessageEdit.Placeholder = new Rope.Leaf(localizationManager.GetString("war-declarator-message-placeholder"));
|
||||
MessageEdit.Placeholder = new Rope.Leaf(_localizationManager.GetString("war-declarator-message-placeholder"));
|
||||
}
|
||||
|
||||
protected override void FrameUpdate(FrameEventArgs args)
|
||||
|
||||
Reference in New Issue
Block a user