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,15 +1,15 @@
using Content.Shared.GameObjects.Components;
using JetBrains.Annotations;
using Robust.Client.GameObjects;
using Robust.Client.UserInterface.Controls;
using Robust.Shared.GameObjects;
using static Content.Shared.GameObjects.Components.SharedPaperComponent;
namespace Content.Client.GameObjects.Components.Paper
{
[UsedImplicitly]
public class PaperBoundUserInterface : BoundUserInterface
{
private PaperWindow _window;
private PaperWindow? _window;
public PaperBoundUserInterface(ClientUserInterfaceComponent owner, object uiKey) : base(owner, uiKey)
{
@@ -31,15 +31,19 @@ namespace Content.Client.GameObjects.Components.Paper
protected override void UpdateState(BoundUserInterfaceState state)
{
base.UpdateState(state);
_window.Populate((SharedPaperComponent.PaperBoundUserInterfaceState)state);
_window?.Populate((PaperBoundUserInterfaceState) state);
}
private void Input_OnTextEntered(LineEdit.LineEditEventArgs obj)
{
if(!string.IsNullOrEmpty(obj.Text))
if (!string.IsNullOrEmpty(obj.Text))
{
SendMessage(new SharedPaperComponent.PaperInputText(obj.Text));
_window.Input.Text = string.Empty;
SendMessage(new PaperInputText(obj.Text));
if (_window != null)
{
_window.Input.Text = string.Empty;
}
}
}
}