Enable nullability in Content.Client (#3257)
* Enable nullability in Content.Client * Remove #nullable enable * Merge fixes * Remove Debug.Assert * Merge fixes * Fix build * Fix build
This commit is contained in:
@@ -1,15 +1,14 @@
|
||||
using Content.Shared.GameObjects.Components;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
|
||||
namespace Content.Client.ParticleAccelerator
|
||||
namespace Content.Client.UserInterface.ParticleAccelerator
|
||||
{
|
||||
public class ParticleAcceleratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private ParticleAcceleratorControlMenu _menu;
|
||||
private ParticleAcceleratorControlMenu? _menu;
|
||||
|
||||
public ParticleAcceleratorBoundUserInterface([NotNull] ClientUserInterfaceComponent owner, [NotNull] object uiKey) : base(owner, uiKey)
|
||||
public ParticleAcceleratorBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -39,14 +38,14 @@ namespace Content.Client.ParticleAccelerator
|
||||
|
||||
protected override void UpdateState(BoundUserInterfaceState state)
|
||||
{
|
||||
_menu.DataUpdate((ParticleAcceleratorUIState) state);
|
||||
_menu?.DataUpdate((ParticleAcceleratorUIState) state);
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
base.Dispose(disposing);
|
||||
|
||||
_menu.Close();
|
||||
_menu?.Close();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
using System;
|
||||
using Content.Client.UserInterface;
|
||||
using Content.Client.UserInterface.Stylesheets;
|
||||
using Content.Client.Utility;
|
||||
using Content.Shared.GameObjects.Components;
|
||||
@@ -16,7 +15,7 @@ using Robust.Shared.Noise;
|
||||
using Robust.Shared.Prototypes;
|
||||
using Robust.Shared.Timing;
|
||||
|
||||
namespace Content.Client.ParticleAccelerator
|
||||
namespace Content.Client.UserInterface.ParticleAccelerator
|
||||
{
|
||||
public sealed class ParticleAcceleratorControlMenu : BaseWindow
|
||||
{
|
||||
@@ -101,11 +100,7 @@ namespace Content.Client.ParticleAccelerator
|
||||
MouseFilter = MouseFilterMode.Pass
|
||||
});
|
||||
|
||||
_stateSpinBox = new SpinBox
|
||||
{
|
||||
Value = 0,
|
||||
};
|
||||
_stateSpinBox.IsValid = StrengthSpinBoxValid;
|
||||
_stateSpinBox = new SpinBox {Value = 0, IsValid = StrengthSpinBoxValid,};
|
||||
_stateSpinBox.InitDefaultButtons();
|
||||
_stateSpinBox.ValueChanged += PowerStateChanged;
|
||||
_stateSpinBox.LineEditDisabled = true;
|
||||
@@ -336,7 +331,7 @@ namespace Content.Client.ParticleAccelerator
|
||||
return (n >= 0 && n <= 4 && !_blockSpinBox);
|
||||
}
|
||||
|
||||
private void PowerStateChanged(object sender, ValueChangedEventArgs e)
|
||||
private void PowerStateChanged(object? sender, ValueChangedEventArgs e)
|
||||
{
|
||||
ParticleAcceleratorPowerState newState;
|
||||
switch (e.Value)
|
||||
|
||||
Reference in New Issue
Block a user