Enable nullability in Content.Server (#3685)

This commit is contained in:
DrSmugleaf
2021-03-16 15:50:20 +01:00
committed by GitHub
parent 90fec0ed24
commit a5ade526b7
306 changed files with 1616 additions and 1441 deletions

View File

@@ -20,7 +20,7 @@ namespace Content.Client.GameObjects.Components.CloningPod
base.Open();
_window = new CloningPodWindow(new Dictionary<int, string>());
_window = new CloningPodWindow(new Dictionary<int, string?>());
_window.OnClose += Close;
_window.CloneButton.OnPressed += _ =>
{

View File

@@ -11,7 +11,7 @@ namespace Content.Client.GameObjects.Components.CloningPod
{
public sealed class CloningPodWindow : SS14Window
{
private Dictionary<int, string> _scanManager;
private Dictionary<int, string?> _scanManager;
private readonly VBoxContainer _scanList;
public readonly Button CloneButton;
@@ -21,11 +21,11 @@ namespace Content.Client.GameObjects.Components.CloningPod
private readonly ProgressBar _cloningProgressBar;
private readonly Label _mindState;
private CloningPodBoundUserInterfaceState _lastUpdate = null!;
private CloningPodBoundUserInterfaceState? _lastUpdate;
public int? SelectedScan;
public CloningPodWindow(Dictionary<int, string> scanManager)
public CloningPodWindow(Dictionary<int, string?> scanManager)
{
SetSize = MinSize = (250, 300);
_scanManager = scanManager;
@@ -120,7 +120,7 @@ namespace Content.Client.GameObjects.Components.CloningPod
{
var button = new CloningScanButton
{
Scan = scan.Value,
Scan = scan.Value ?? string.Empty,
Id = scan.Key
};
button.ActualButton.OnToggled += OnItemButtonToggled;

View File

@@ -20,7 +20,7 @@ namespace Content.Client.GameObjects.Components.Interactable
[ViewVariables(VVAccess.ReadWrite)] private bool _uiUpdateNeeded;
[ViewVariables] public bool StatusShowBehavior => _statusShowBehavior;
[ViewVariables] public ToolQuality Behavior => _behavior;
[ViewVariables] public ToolQuality? Behavior => _behavior;
public override string Name => "MultiTool";
public override uint? NetID => ContentNetIDs.MULTITOOLS;
@@ -63,11 +63,7 @@ namespace Content.Client.GameObjects.Components.Interactable
_parent._uiUpdateNeeded = false;
if(!_parent.StatusShowBehavior)
_label.SetMarkup(string.Empty);
else
_label.SetMarkup(_parent.Behavior.ToString());
_label.SetMarkup(_parent.StatusShowBehavior ? _parent.Behavior.ToString() ?? string.Empty : string.Empty);
}
}
}

View File

@@ -41,7 +41,7 @@ namespace Content.Client.GameObjects.Components.Mobs
private void UpdateLooks()
{
if (Appearance is null ||
if (Appearance is null! ||
!Owner.TryGetComponent(out SpriteComponent? sprite))
{
return;