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

@@ -15,9 +15,9 @@ namespace Content.Client.GameObjects.Components.Trigger
private const string AnimationKey = "priming_animation";
[DataField("countdown_sound", required: true)]
private string _countdownSound;
private string? _countdownSound;
private Animation PrimingAnimation;
private Animation PrimingAnimation = default!;
void ISerializationHooks.AfterDeserialization()
{
@@ -28,9 +28,12 @@ namespace Content.Client.GameObjects.Components.Trigger
flick.LayerKey = TriggerVisualLayers.Base;
flick.KeyFrames.Add(new AnimationTrackSpriteFlick.KeyFrame("primed", 0f));
var sound = new AnimationTrackPlaySound();
PrimingAnimation.AnimationTracks.Add(sound);
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_countdownSound, 0));
if (_countdownSound != null)
{
var sound = new AnimationTrackPlaySound();
PrimingAnimation.AnimationTracks.Add(sound);
sound.KeyFrames.Add(new AnimationTrackPlaySound.KeyFrame(_countdownSound, 0));
}
}
}