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

Fix TestCasePerformancePoints binding to global beatmap

and never unbinding
This commit is contained in:
Dean Herbert 2018-01-03 13:34:08 +09:00
parent 254490def1
commit 61c2bf7ebe

View File

@ -7,6 +7,7 @@ using OpenTK;
using OpenTK.Graphics; using OpenTK.Graphics;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Caching; using osu.Framework.Caching;
using osu.Framework.Configuration;
using osu.Framework.Extensions.IEnumerableExtensions; using osu.Framework.Extensions.IEnumerableExtensions;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
@ -203,6 +204,8 @@ namespace osu.Game.Tests.Visual
private readonly FillFlowContainer<PerformanceDisplay> scores; private readonly FillFlowContainer<PerformanceDisplay> scores;
private APIAccess api; private APIAccess api;
private readonly Bindable<WorkingBeatmap> currentBeatmap = new Bindable<WorkingBeatmap>();
public PerformanceList() public PerformanceList()
{ {
RelativeSizeAxes = Axes.X; 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 GetScoresRequest lastRequest;
private void beatmapChanged(WorkingBeatmap newBeatmap) private void beatmapChanged(WorkingBeatmap newBeatmap)
{ {
if (!IsAlive) return;
lastRequest?.Cancel(); lastRequest?.Cancel();
scores.Clear(); scores.Clear();