1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 16:52:54 +08:00

Merge pull request #1837 from peppy/fix-testcase-performance

Fix TestCasePerformancePoints binding to global beatmap
This commit is contained in:
Dan Balasescu 2018-01-03 14:12:36 +09:00 committed by GitHub
commit 267e624e8c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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();