private void loadNewPanel(BeatmapInfo beatmap) { loadCancellation?.Cancel(); request?.Cancel(); panel?.FadeOut(200); panel?.Expire(); panel = null; if (beatmap?.OnlineBeatmapID == null) { return; } loadCancellation = new CancellationTokenSource(); request = new GetBeatmapSetRequest(beatmap.OnlineBeatmapID.Value, BeatmapSetLookupType.BeatmapId); request.Success += res => Schedule(() => { panel = new DirectGridPanel(res.ToBeatmapSet(rulesets)); LoadComponentAsync(panel, AddInternal, loadCancellation.Token); }); api.Queue(request); }
private void clearDisplay() { watchButton.Enabled.Value = false; onlineBeatmapRequest?.Cancel(); beatmapPanelContainer.Clear(); previewTrackManager.StopAnyPlaying(this); }