From cb49147d1e17d14c8b6a63c5a2e3b535a36f57a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 12:57:30 +0200 Subject: [PATCH 01/11] Apply NRT to `ScorePanelList` --- osu.Game/Screens/Ranking/ResultsScreen.cs | 2 ++ osu.Game/Screens/Ranking/ScorePanelList.cs | 19 +++++++------------ 2 files changed, 9 insertions(+), 12 deletions(-) diff --git a/osu.Game/Screens/Ranking/ResultsScreen.cs b/osu.Game/Screens/Ranking/ResultsScreen.cs index 1c3518909d..44b270db53 100644 --- a/osu.Game/Screens/Ranking/ResultsScreen.cs +++ b/osu.Game/Screens/Ranking/ResultsScreen.cs @@ -3,6 +3,7 @@ using System; using System.Collections.Generic; +using System.Diagnostics; using System.Linq; using osu.Framework.Allocation; using osu.Framework.Audio; @@ -329,6 +330,7 @@ namespace osu.Game.Screens.Ranking { if (state.NewValue == Visibility.Visible) { + Debug.Assert(SelectedScore.Value != null); // Detach the panel in its original location, and move into the desired location in the local container. var expandedPanel = ScorePanelList.GetPanelForScore(SelectedScore.Value); var screenSpacePos = expandedPanel.ScreenSpaceDrawQuad.TopLeft; diff --git a/osu.Game/Screens/Ranking/ScorePanelList.cs b/osu.Game/Screens/Ranking/ScorePanelList.cs index 95c90e35a0..e711bed729 100644 --- a/osu.Game/Screens/Ranking/ScorePanelList.cs +++ b/osu.Game/Screens/Ranking/ScorePanelList.cs @@ -1,14 +1,11 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Threading; -using JetBrains.Annotations; using osu.Framework.Bindables; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -64,14 +61,14 @@ namespace osu.Game.Screens.Ranking /// /// An action to be invoked if a is clicked while in an expanded state. /// - public Action PostExpandAction; + public Action? PostExpandAction; - public readonly Bindable SelectedScore = new Bindable(); + public readonly Bindable SelectedScore = new Bindable(); private readonly CancellationTokenSource loadCancellationSource = new CancellationTokenSource(); private readonly Flow flow; private readonly Scroll scroll; - private ScorePanel expandedPanel; + private ScorePanel? expandedPanel; /// /// Creates a new . @@ -174,7 +171,7 @@ namespace osu.Game.Screens.Ranking /// Brings a to the centre of the screen and expands it. /// /// The to present. - private void selectedScoreChanged(ValueChangedEvent score) + private void selectedScoreChanged(ValueChangedEvent score) { // avoid contracting panels unnecessarily when TriggerChange is fired manually. if (score.OldValue != null && !score.OldValue.Equals(score.NewValue)) @@ -317,7 +314,7 @@ namespace osu.Game.Screens.Ranking protected override void Dispose(bool isDisposing) { base.Dispose(isDisposing); - loadCancellationSource?.Cancel(); + loadCancellationSource.Cancel(); } private partial class Flow : FillFlowContainer @@ -326,11 +323,9 @@ namespace osu.Game.Screens.Ranking public int GetPanelIndex(ScoreInfo score) => applySorting(Children).TakeWhile(s => !s.Panel.Score.Equals(score)).Count(); - [CanBeNull] - public ScoreInfo GetPreviousScore(ScoreInfo score) => applySorting(Children).TakeWhile(s => !s.Panel.Score.Equals(score)).LastOrDefault()?.Panel.Score; + public ScoreInfo? GetPreviousScore(ScoreInfo score) => applySorting(Children).TakeWhile(s => !s.Panel.Score.Equals(score)).LastOrDefault()?.Panel.Score; - [CanBeNull] - public ScoreInfo GetNextScore(ScoreInfo score) => applySorting(Children).SkipWhile(s => !s.Panel.Score.Equals(score)).ElementAtOrDefault(1)?.Panel.Score; + public ScoreInfo? GetNextScore(ScoreInfo score) => applySorting(Children).SkipWhile(s => !s.Panel.Score.Equals(score)).ElementAtOrDefault(1)?.Panel.Score; private IEnumerable applySorting(IEnumerable drawables) => drawables.OfType() .OrderByDescending(GetLayoutPosition) From 10a8e84046ac4e8abb06e44ab112e2b3274bb2d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:01:26 +0200 Subject: [PATCH 02/11] Apply NRT to `StatisticsPanel` --- .../Ranking/Statistics/StatisticsPanel.cs | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs index 19bd0c4393..f9f5254bc2 100644 --- a/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs +++ b/osu.Game/Screens/Ranking/Statistics/StatisticsPanel.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System.Collections.Generic; using System.Linq; using System.Threading; @@ -28,19 +26,20 @@ namespace osu.Game.Screens.Ranking.Statistics { public const float SIDE_PADDING = 30; - public readonly Bindable Score = new Bindable(); + public readonly Bindable Score = new Bindable(); protected override bool StartHidden => true; [Resolved] - private BeatmapManager beatmapManager { get; set; } + private BeatmapManager beatmapManager { get; set; } = null!; private readonly Container content; private readonly LoadingSpinner spinner; private bool wasOpened; - private Sample popInSample; - private Sample popOutSample; + private Sample? popInSample; + private Sample? popOutSample; + private CancellationTokenSource? loadCancellation; public StatisticsPanel() { @@ -71,9 +70,7 @@ namespace osu.Game.Screens.Ranking.Statistics popOutSample = audio.Samples.Get(@"Results/statistics-panel-pop-out"); } - private CancellationTokenSource loadCancellation; - - private void populateStatistics(ValueChangedEvent score) + private void populateStatistics(ValueChangedEvent score) { loadCancellation?.Cancel(); loadCancellation = null; @@ -187,7 +184,7 @@ namespace osu.Game.Screens.Ranking.Statistics LoadComponentAsync(container, d => { - if (!Score.Value.Equals(newScore)) + if (Score.Value?.Equals(newScore) != true) return; spinner.Hide(); From 77a7f475ee25314cc7d68e612f8bfbf2beae2ace Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:03:46 +0200 Subject: [PATCH 03/11] Apply NRT to `ScorePanel` --- osu.Game/Screens/Ranking/ScorePanel.cs | 34 ++++++++++++-------------- 1 file changed, 15 insertions(+), 19 deletions(-) diff --git a/osu.Game/Screens/Ranking/ScorePanel.cs b/osu.Game/Screens/Ranking/ScorePanel.cs index 1f7ba3692a..e283749e32 100644 --- a/osu.Game/Screens/Ranking/ScorePanel.cs +++ b/osu.Game/Screens/Ranking/ScorePanel.cs @@ -1,10 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; -using JetBrains.Annotations; using osu.Framework; using osu.Framework.Allocation; using osu.Framework.Audio; @@ -83,8 +80,7 @@ namespace osu.Game.Screens.Ranking private static readonly Color4 contracted_top_layer_colour = Color4Extensions.FromHex("#353535"); private static readonly Color4 contracted_middle_layer_colour = Color4Extensions.FromHex("#353535"); - [CanBeNull] - public event Action StateChanged; + public event Action? StateChanged; /// /// The position of the score in the rankings. @@ -94,28 +90,30 @@ namespace osu.Game.Screens.Ranking /// /// An action to be invoked if this is clicked while in an expanded state. /// - public Action PostExpandAction; + public Action? PostExpandAction; public readonly ScoreInfo Score; [Resolved] - private OsuGameBase game { get; set; } + private OsuGameBase game { get; set; } = null!; - private AudioContainer audioContent; + private AudioContainer audioContent = null!; private bool displayWithFlair; - private Container topLayerContainer; - private Drawable topLayerBackground; - private Container topLayerContentContainer; - private Drawable topLayerContent; + private Container topLayerContainer = null!; + private Drawable topLayerBackground = null!; + private Container topLayerContentContainer = null!; + private Drawable? topLayerContent; - private Container middleLayerContainer; - private Drawable middleLayerBackground; - private Container middleLayerContentContainer; - private Drawable middleLayerContent; + private Container middleLayerContainer = null!; + private Drawable middleLayerBackground = null!; + private Container middleLayerContentContainer = null!; + private Drawable? middleLayerContent; - private DrawableSample samplePanelFocus; + private ScorePanelTrackingContainer? trackingContainer; + + private DrawableSample? samplePanelFocus; public ScorePanel(ScoreInfo score, bool isNewLocalScore = false) { @@ -334,8 +332,6 @@ namespace osu.Game.Screens.Ranking || topLayerContainer.ReceivePositionalInputAt(screenSpacePos) || middleLayerContainer.ReceivePositionalInputAt(screenSpacePos); - private ScorePanelTrackingContainer trackingContainer; - /// /// Creates a which this can reside inside. /// The will track the size of this . From 2f2257f6cec8254ca48432d6811a0cb823f0364c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:07:49 +0200 Subject: [PATCH 04/11] Apply NRT to `PerformanceBreakdownChart` --- .../Statistics/PerformanceBreakdownChart.cs | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs b/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs index 8b13f0951c..b5eed2d12a 100644 --- a/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs +++ b/osu.Game/Screens/Ranking/Statistics/PerformanceBreakdownChart.cs @@ -1,13 +1,10 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using System.Linq; using System.Threading; -using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Extensions; using osu.Framework.Extensions.Color4Extensions; @@ -31,16 +28,16 @@ namespace osu.Game.Screens.Ranking.Statistics private readonly ScoreInfo score; private readonly IBeatmap playableBeatmap; - private Drawable spinner; - private Drawable content; - private GridContainer chart; - private OsuSpriteText achievedPerformance; - private OsuSpriteText maximumPerformance; + private Drawable spinner = null!; + private Drawable content = null!; + private GridContainer chart = null!; + private OsuSpriteText achievedPerformance = null!; + private OsuSpriteText maximumPerformance = null!; private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); [Resolved] - private BeatmapDifficultyCache difficultyCache { get; set; } + private BeatmapDifficultyCache difficultyCache { get; set; } = null!; public PerformanceBreakdownChart(ScoreInfo score, IBeatmap playableBeatmap) { @@ -147,7 +144,7 @@ namespace osu.Game.Screens.Ranking.Statistics new PerformanceBreakdownCalculator(playableBeatmap, difficultyCache) .CalculateAsync(score, cancellationTokenSource.Token) - .ContinueWith(t => Schedule(() => setPerformanceValue(t.GetResultSafely()))); + .ContinueWith(t => Schedule(() => setPerformanceValue(t.GetResultSafely()!))); } private void setPerformanceValue(PerformanceBreakdown breakdown) @@ -189,8 +186,7 @@ namespace osu.Game.Screens.Ranking.Statistics maximumPerformance.Text = Math.Round(perfectAttribute.Value, MidpointRounding.AwayFromZero).ToLocalisableString(); } - [CanBeNull] - private Drawable[] createAttributeRow(PerformanceDisplayAttribute attribute, PerformanceDisplayAttribute perfectAttribute) + private Drawable[]? createAttributeRow(PerformanceDisplayAttribute attribute, PerformanceDisplayAttribute perfectAttribute) { // Don't display the attribute if its maximum is 0 // For example, flashlight bonus would be zero if flashlight mod isn't on @@ -239,7 +235,7 @@ namespace osu.Game.Screens.Ranking.Statistics protected override void Dispose(bool isDisposing) { - cancellationTokenSource?.Cancel(); + cancellationTokenSource.Cancel(); base.Dispose(isDisposing); } } From 237ae8b46a2c66af53a350e6972696d2cda79686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:09:57 +0200 Subject: [PATCH 05/11] Apply NRT to `SimpleStatisticsItem` --- osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs index 23ccc3d0b7..d8de1b07b5 100644 --- a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs +++ b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticItem.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Game.Graphics; @@ -61,7 +59,7 @@ namespace osu.Game.Screens.Ranking.Statistics /// public partial class SimpleStatisticItem : SimpleStatisticItem { - private TValue value; + private TValue value = default!; /// /// The statistic's value to be displayed. @@ -80,7 +78,7 @@ namespace osu.Game.Screens.Ranking.Statistics /// Used to convert to a text representation. /// Defaults to using . /// - protected virtual string DisplayValue(TValue value) => value.ToString(); + protected virtual string DisplayValue(TValue value) => value!.ToString() ?? string.Empty; public SimpleStatisticItem(string name) : base(name) From 8e16b57d09663ecfd310487bb58db523b533e4b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:10:36 +0200 Subject: [PATCH 06/11] Apply NRT to `SimpleStatisticTable` --- .../Screens/Ranking/Statistics/SimpleStatisticTable.cs | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs index 4abf0007a7..da79fdb12b 100644 --- a/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs +++ b/osu.Game/Screens/Ranking/Statistics/SimpleStatisticTable.cs @@ -1,12 +1,9 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using System.Linq; -using JetBrains.Annotations; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; @@ -24,14 +21,14 @@ namespace osu.Game.Screens.Ranking.Statistics private readonly SimpleStatisticItem[] items; private readonly int columnCount; - private FillFlowContainer[] columns; + private FillFlowContainer[] columns = null!; /// /// Creates a statistic row for the supplied s. /// /// The number of columns to layout the into. /// The s to display in this row. - public SimpleStatisticTable(int columnCount, [ItemNotNull] IEnumerable items) + public SimpleStatisticTable(int columnCount, IEnumerable items) { ArgumentOutOfRangeException.ThrowIfNegativeOrZero(columnCount); From e7721b073cbd09651b48b9253e2d7d963339f5e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:11:21 +0200 Subject: [PATCH 07/11] Apply NRT to `ContractedPanelTopContent` --- .../Screens/Ranking/Contracted/ContractedPanelTopContent.cs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/osu.Game/Screens/Ranking/Contracted/ContractedPanelTopContent.cs b/osu.Game/Screens/Ranking/Contracted/ContractedPanelTopContent.cs index 93bc7c41e1..06d127b972 100644 --- a/osu.Game/Screens/Ranking/Contracted/ContractedPanelTopContent.cs +++ b/osu.Game/Screens/Ranking/Contracted/ContractedPanelTopContent.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -16,7 +14,7 @@ namespace osu.Game.Screens.Ranking.Contracted { public readonly Bindable ScorePosition = new Bindable(); - private OsuSpriteText text; + private OsuSpriteText text = null!; public ContractedPanelTopContent() { From ced1c79490f61b6d203d3777c740139e1cd7ff51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:14:52 +0200 Subject: [PATCH 08/11] Apply NRT to `AccuracyCircle` --- .../Expanded/Accuracy/AccuracyCircle.cs | 42 +++++++++---------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs index f04e4a6444..cebc54f490 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/AccuracyCircle.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using System.Linq; @@ -93,17 +91,17 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy private readonly ScoreInfo score; - private CircularProgress accuracyCircle; - private GradedCircles gradedCircles; - private Container badges; - private RankText rankText; + private CircularProgress accuracyCircle = null!; + private GradedCircles gradedCircles = null!; + private Container badges = null!; + private RankText rankText = null!; - private PoolableSkinnableSample scoreTickSound; - private PoolableSkinnableSample badgeTickSound; - private PoolableSkinnableSample badgeMaxSound; - private PoolableSkinnableSample swooshUpSound; - private PoolableSkinnableSample rankImpactSound; - private PoolableSkinnableSample rankApplauseSound; + private PoolableSkinnableSample? scoreTickSound; + private PoolableSkinnableSample? badgeTickSound; + private PoolableSkinnableSample? badgeMaxSound; + private PoolableSkinnableSample? swooshUpSound; + private PoolableSkinnableSample? rankImpactSound; + private PoolableSkinnableSample? rankApplauseSound; private readonly Bindable tickPlaybackRate = new Bindable(); @@ -119,7 +117,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy private readonly bool withFlair; private readonly bool isFailedSDueToMisses; - private RankText failedSRankText; + private RankText failedSRankText = null!; public AccuracyCircle(ScoreInfo score, bool withFlair = false) { @@ -229,8 +227,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy this.Delay(swoosh_pre_delay).Schedule(() => { - swooshUpSound.VolumeTo(swoosh_volume); - swooshUpSound.Play(); + swooshUpSound!.VolumeTo(swoosh_volume); + swooshUpSound!.Play(); }); } @@ -287,8 +285,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy this.TransformBindableTo(tickPlaybackRate, score_tick_debounce_rate_start); this.TransformBindableTo(tickPlaybackRate, score_tick_debounce_rate_end, ACCURACY_TRANSFORM_DURATION, Easing.OutSine); - scoreTickSound.FrequencyTo(1 + targetAccuracy, ACCURACY_TRANSFORM_DURATION, Easing.OutSine); - scoreTickSound.VolumeTo(score_tick_volume_start).Then().VolumeTo(score_tick_volume_end, ACCURACY_TRANSFORM_DURATION, Easing.OutSine); + scoreTickSound!.FrequencyTo(1 + targetAccuracy, ACCURACY_TRANSFORM_DURATION, Easing.OutSine); + scoreTickSound!.VolumeTo(score_tick_volume_start).Then().VolumeTo(score_tick_volume_end, ACCURACY_TRANSFORM_DURATION, Easing.OutSine); isTicking = true; }); @@ -314,8 +312,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { var dink = badgeNum < badges.Count - 1 ? badgeTickSound : badgeMaxSound; - dink.FrequencyTo(1 + badgeNum++ * 0.05); - dink.Play(); + dink!.FrequencyTo(1 + badgeNum++ * 0.05); + dink!.Play(); }); } } @@ -331,7 +329,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy Schedule(() => { isTicking = false; - rankImpactSound.Play(); + rankImpactSound!.Play(); }); const double applause_pre_delay = 545f; @@ -341,8 +339,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { Schedule(() => { - rankApplauseSound.VolumeTo(applause_volume); - rankApplauseSound.Play(); + rankApplauseSound!.VolumeTo(applause_volume); + rankApplauseSound!.Play(); }); } } From b937b94bd2feb31995cbb2b0e0c0cc8126195b77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:15:21 +0200 Subject: [PATCH 09/11] Apply NRT to `RankBadge` --- osu.Game/Screens/Ranking/Expanded/Accuracy/RankBadge.cs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/RankBadge.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/RankBadge.cs index 8aea6045eb..0e798c7d6e 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/RankBadge.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/RankBadge.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; @@ -34,8 +32,8 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy public readonly ScoreRank Rank; - private Drawable rankContainer; - private Drawable overlay; + private Drawable rankContainer = null!; + private Drawable overlay = null!; /// /// Creates a new . From 414f023817027d0433d99b921177e5f98b0ff2e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:15:51 +0200 Subject: [PATCH 10/11] Apply NRT to `RankText` --- osu.Game/Screens/Ranking/Expanded/Accuracy/RankText.cs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Accuracy/RankText.cs b/osu.Game/Screens/Ranking/Expanded/Accuracy/RankText.cs index b7adcb032f..76e59b32b8 100644 --- a/osu.Game/Screens/Ranking/Expanded/Accuracy/RankText.cs +++ b/osu.Game/Screens/Ranking/Expanded/Accuracy/RankText.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; @@ -23,9 +21,9 @@ namespace osu.Game.Screens.Ranking.Expanded.Accuracy { private readonly ScoreRank rank; - private BufferedContainer flash; - private BufferedContainer superFlash; - private GlowingSpriteText rankText; + private BufferedContainer flash = null!; + private BufferedContainer superFlash = null!; + private GlowingSpriteText rankText = null!; public RankText(ScoreRank rank) { From ee9144c3bddd0b16b7bd18dd51222bfdadec5f18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bart=C5=82omiej=20Dach?= Date: Tue, 14 May 2024 13:17:31 +0200 Subject: [PATCH 11/11] Apply NRT to results statistics displays --- .../Ranking/Expanded/Statistics/AccuracyStatistic.cs | 4 +--- .../Screens/Ranking/Expanded/Statistics/ComboStatistic.cs | 4 +--- .../Screens/Ranking/Expanded/Statistics/CounterStatistic.cs | 4 +--- .../Ranking/Expanded/Statistics/PerformanceStatistic.cs | 6 ++---- .../Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs | 6 ++---- 5 files changed, 7 insertions(+), 17 deletions(-) diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs index f1f2c47e20..a4672a475c 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/AccuracyStatistic.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Graphics; using osu.Framework.Localisation; using osu.Game.Graphics; @@ -22,7 +20,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics { private readonly double accuracy; - private RollingCounter counter; + private RollingCounter counter = null!; /// /// Creates a new . diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs index 6290cee6da..7c91a37b77 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/ComboStatistic.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Graphics; using osu.Framework.Graphics.Colour; @@ -22,7 +20,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics { private readonly bool isPerfect; - private Drawable perfectText; + private Drawable perfectText = null!; /// /// Creates a new . diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs index 8528dac83b..4042724c75 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/CounterStatistic.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Graphics; using osu.Framework.Graphics.Containers; using osu.Framework.Localisation; @@ -21,7 +19,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics private readonly int count; private readonly int? maxCount; - private RollingCounter counter; + private RollingCounter counter = null!; /// /// Creates a new . diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs index 8366f8d7ef..7ea3cbe917 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/PerformanceStatistic.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using System; using System.Collections.Generic; using System.Linq; @@ -32,7 +30,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics private readonly CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); - private RollingCounter counter; + private RollingCounter counter = null!; public PerformanceStatistic(ScoreInfo score) : base(BeatmapsetsStrings.ShowScoreboardHeaderspp) @@ -107,7 +105,7 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics protected override void Dispose(bool isDisposing) { - cancellationTokenSource?.Cancel(); + cancellationTokenSource.Cancel(); base.Dispose(isDisposing); } diff --git a/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs b/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs index 686b6c7d47..9de60f013d 100644 --- a/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs +++ b/osu.Game/Screens/Ranking/Expanded/Statistics/StatisticDisplay.cs @@ -1,8 +1,6 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. -#nullable disable - using osu.Framework.Allocation; using osu.Framework.Extensions.Color4Extensions; using osu.Framework.Extensions.LocalisationExtensions; @@ -21,10 +19,10 @@ namespace osu.Game.Screens.Ranking.Expanded.Statistics /// public abstract partial class StatisticDisplay : CompositeDrawable { - protected SpriteText HeaderText { get; private set; } + protected SpriteText HeaderText { get; private set; } = null!; private readonly LocalisableString header; - private Drawable content; + private Drawable content = null!; /// /// Creates a new .