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,4 +1,5 @@
|
||||
using Content.Shared.GameObjects.Components.Gravity;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Client.GameObjects;
|
||||
using Robust.Client.UserInterface.Controls;
|
||||
using Robust.Client.UserInterface.CustomControls;
|
||||
@@ -9,9 +10,10 @@ using Robust.Shared.Maths;
|
||||
|
||||
namespace Content.Client.GameObjects.Components.Gravity
|
||||
{
|
||||
public class GravityGeneratorBoundUserInterface: BoundUserInterface
|
||||
[UsedImplicitly]
|
||||
public class GravityGeneratorBoundUserInterface : BoundUserInterface
|
||||
{
|
||||
private GravityGeneratorWindow _window;
|
||||
private GravityGeneratorWindow? _window;
|
||||
|
||||
public bool IsOn;
|
||||
|
||||
@@ -28,7 +30,7 @@ namespace Content.Client.GameObjects.Components.Gravity
|
||||
|
||||
_window = new GravityGeneratorWindow(this);
|
||||
|
||||
_window.Switch.OnPressed += (args) =>
|
||||
_window.Switch.OnPressed += (_) =>
|
||||
{
|
||||
SendMessage(new SharedGravityGeneratorComponent.SwitchGeneratorMessage(!IsOn));
|
||||
SendMessage(new SharedGravityGeneratorComponent.GeneratorStatusRequestMessage());
|
||||
@@ -43,7 +45,7 @@ namespace Content.Client.GameObjects.Components.Gravity
|
||||
|
||||
var castState = (SharedGravityGeneratorComponent.GeneratorState) state;
|
||||
IsOn = castState.On;
|
||||
_window.UpdateButton();
|
||||
_window?.UpdateButton();
|
||||
}
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
@@ -63,11 +65,11 @@ namespace Content.Client.GameObjects.Components.Gravity
|
||||
|
||||
public GravityGeneratorBoundUserInterface Owner;
|
||||
|
||||
public GravityGeneratorWindow(GravityGeneratorBoundUserInterface gravityGeneratorInterface = null)
|
||||
public GravityGeneratorWindow(GravityGeneratorBoundUserInterface ui)
|
||||
{
|
||||
IoCManager.InjectDependencies(this);
|
||||
|
||||
Owner = gravityGeneratorInterface;
|
||||
Owner = ui;
|
||||
|
||||
Title = Loc.GetString("Gravity Generator Control");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user