mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 16:12:54 +08:00
Apply NRT to StatisticsPanel
This commit is contained in:
parent
cb49147d1e
commit
10a8e84046
@ -1,8 +1,6 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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<ScoreInfo> Score = new Bindable<ScoreInfo>();
|
||||
public readonly Bindable<ScoreInfo?> Score = new Bindable<ScoreInfo?>();
|
||||
|
||||
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<ScoreInfo> score)
|
||||
private void populateStatistics(ValueChangedEvent<ScoreInfo?> 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();
|
||||
|
Loading…
Reference in New Issue
Block a user