mirror of
https://github.com/ppy/osu.git
synced 2024-12-15 03:22:55 +08:00
Merge pull request #1837 from peppy/fix-testcase-performance
Fix TestCasePerformancePoints binding to global beatmap
This commit is contained in:
commit
267e624e8c
@ -7,6 +7,7 @@ using OpenTK;
|
||||
using OpenTK.Graphics;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Caching;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Extensions.IEnumerableExtensions;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
@ -203,6 +204,8 @@ namespace osu.Game.Tests.Visual
|
||||
private readonly FillFlowContainer<PerformanceDisplay> scores;
|
||||
private APIAccess api;
|
||||
|
||||
private readonly Bindable<WorkingBeatmap> currentBeatmap = new Bindable<WorkingBeatmap>();
|
||||
|
||||
public PerformanceList()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
@ -231,12 +234,15 @@ namespace osu.Game.Tests.Visual
|
||||
};
|
||||
}
|
||||
|
||||
osuGame.Beatmap.ValueChanged += beatmapChanged;
|
||||
currentBeatmap.ValueChanged += beatmapChanged;
|
||||
currentBeatmap.BindTo(osuGame.Beatmap);
|
||||
}
|
||||
|
||||
private GetScoresRequest lastRequest;
|
||||
private void beatmapChanged(WorkingBeatmap newBeatmap)
|
||||
{
|
||||
if (!IsAlive) return;
|
||||
|
||||
lastRequest?.Cancel();
|
||||
scores.Clear();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user