mirror of
https://github.com/ppy/osu.git
synced 2025-01-14 02:22:56 +08:00
Correctly delay loading of PlaySongSelect-specific components
This commit is contained in:
parent
f9d02afb00
commit
3d61cde266
@ -54,13 +54,11 @@ namespace osu.Game.Screens.Select
|
||||
ValidForResume = false;
|
||||
Push(new Editor());
|
||||
}, Key.Number3);
|
||||
|
||||
Beatmap.ValueChanged += beatmap_ValueChanged;
|
||||
}
|
||||
|
||||
private void beatmap_ValueChanged(WorkingBeatmap beatmap)
|
||||
protected override void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
if (!IsCurrentScreen) return;
|
||||
base.UpdateBeatmap(beatmap);
|
||||
|
||||
beatmap.Mods.BindTo(modSelect.SelectedMods);
|
||||
|
||||
|
@ -244,7 +244,7 @@ namespace osu.Game.Screens.Select
|
||||
ensurePlayingSelected(preview);
|
||||
}
|
||||
|
||||
changeBackground(Beatmap.Value);
|
||||
UpdateBeatmap(Beatmap.Value);
|
||||
};
|
||||
|
||||
selectionChangedDebounce?.Cancel();
|
||||
@ -312,7 +312,7 @@ namespace osu.Game.Screens.Select
|
||||
{
|
||||
if (Beatmap != null && !Beatmap.Value.BeatmapSetInfo.DeletePending)
|
||||
{
|
||||
changeBackground(Beatmap);
|
||||
UpdateBeatmap(Beatmap);
|
||||
ensurePlayingSelected();
|
||||
}
|
||||
|
||||
@ -358,7 +358,12 @@ namespace osu.Game.Screens.Select
|
||||
initialAddSetsTask?.Cancel();
|
||||
}
|
||||
|
||||
private void changeBackground(WorkingBeatmap beatmap)
|
||||
/// <summary>
|
||||
/// Allow components in SongSelect to update their loaded beatmap details.
|
||||
/// This is a debounced call (unlike directly binding to WorkingBeatmap.ValueChanged).
|
||||
/// </summary>
|
||||
/// <param name="beatmap">The working beatmap.</param>
|
||||
protected virtual void UpdateBeatmap(WorkingBeatmap beatmap)
|
||||
{
|
||||
var backgroundModeBeatmap = Background as BackgroundScreenBeatmap;
|
||||
if (backgroundModeBeatmap != null)
|
||||
|
Loading…
Reference in New Issue
Block a user