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:
DrSmugleaf
2021-03-10 14:48:29 +01:00
committed by GitHub
parent 4f9bd4e802
commit 902aa128c2
270 changed files with 1774 additions and 1550 deletions

View File

@@ -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");