mirror of
https://github.com/ppy/osu
synced 2025-02-15 17:47:28 +00: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;
|
ValidForResume = false;
|
||||||
Push(new Editor());
|
Push(new Editor());
|
||||||
}, Key.Number3);
|
}, 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);
|
beatmap.Mods.BindTo(modSelect.SelectedMods);
|
||||||
|
|
||||||
|
@ -244,7 +244,7 @@ namespace osu.Game.Screens.Select
|
|||||||
ensurePlayingSelected(preview);
|
ensurePlayingSelected(preview);
|
||||||
}
|
}
|
||||||
|
|
||||||
changeBackground(Beatmap.Value);
|
UpdateBeatmap(Beatmap.Value);
|
||||||
};
|
};
|
||||||
|
|
||||||
selectionChangedDebounce?.Cancel();
|
selectionChangedDebounce?.Cancel();
|
||||||
@ -312,7 +312,7 @@ namespace osu.Game.Screens.Select
|
|||||||
{
|
{
|
||||||
if (Beatmap != null && !Beatmap.Value.BeatmapSetInfo.DeletePending)
|
if (Beatmap != null && !Beatmap.Value.BeatmapSetInfo.DeletePending)
|
||||||
{
|
{
|
||||||
changeBackground(Beatmap);
|
UpdateBeatmap(Beatmap);
|
||||||
ensurePlayingSelected();
|
ensurePlayingSelected();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -358,7 +358,12 @@ namespace osu.Game.Screens.Select
|
|||||||
initialAddSetsTask?.Cancel();
|
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;
|
var backgroundModeBeatmap = Background as BackgroundScreenBeatmap;
|
||||||
if (backgroundModeBeatmap != null)
|
if (backgroundModeBeatmap != null)
|
||||||
|
Loading…
Reference in New Issue
Block a user