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,3 @@
|
||||
#nullable enable
|
||||
using Content.Client.GameObjects.Components.Mobs;
|
||||
using Content.Client.UserInterface;
|
||||
using Content.Client.UserInterface.Stylesheets;
|
||||
@@ -91,7 +90,7 @@ namespace Content.Client.GameObjects.Components.Actor
|
||||
}
|
||||
});
|
||||
|
||||
AddChild(new Placeholder(resourceCache)
|
||||
AddChild(new Placeholder()
|
||||
{
|
||||
PlaceholderText = Loc.GetString("Health & status effects")
|
||||
});
|
||||
@@ -104,7 +103,7 @@ namespace Content.Client.GameObjects.Components.Actor
|
||||
ObjectivesContainer = new VBoxContainer();
|
||||
AddChild(ObjectivesContainer);
|
||||
|
||||
AddChild(new Placeholder(resourceCache)
|
||||
AddChild(new Placeholder()
|
||||
{
|
||||
PlaceholderText = Loc.GetString("Antagonist Roles")
|
||||
});
|
||||
|
||||
@@ -29,9 +29,9 @@ namespace Content.Client.GameObjects.Components.Actor
|
||||
/// <remarks>
|
||||
/// Null if it would otherwise be empty.
|
||||
/// </remarks>
|
||||
public SS14Window Window { get; private set; }
|
||||
public CharacterWindow? Window { get; private set; }
|
||||
|
||||
private List<ICharacterUI> _uiComponents;
|
||||
private List<ICharacterUI>? _uiComponents;
|
||||
|
||||
/// <summary>
|
||||
/// Create the window with all character UIs and bind it to a keypress
|
||||
@@ -58,10 +58,13 @@ namespace Content.Client.GameObjects.Components.Actor
|
||||
{
|
||||
base.OnRemove();
|
||||
|
||||
foreach (var component in _uiComponents)
|
||||
if (_uiComponents != null)
|
||||
{
|
||||
// Make sure these don't get deleted when the window is disposed.
|
||||
component.Scene.Orphan();
|
||||
foreach (var component in _uiComponents)
|
||||
{
|
||||
// Make sure these don't get deleted when the window is disposed.
|
||||
component.Scene.Orphan();
|
||||
}
|
||||
}
|
||||
|
||||
_uiComponents = null;
|
||||
@@ -73,7 +76,7 @@ namespace Content.Client.GameObjects.Components.Actor
|
||||
inputMgr.SetInputCommand(ContentKeyFunctions.OpenCharacterMenu, null);
|
||||
}
|
||||
|
||||
public override void HandleMessage(ComponentMessage message, IComponent component)
|
||||
public override void HandleMessage(ComponentMessage message, IComponent? component)
|
||||
{
|
||||
base.HandleMessage(message, component);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user