mirror of
https://github.com/ppy/osu.git
synced 2025-01-12 17:23:22 +08:00
Merge pull request #28040 from peppy/fix-background-load-order
Fix incorrect background being loaded due to async race
This commit is contained in:
commit
ff91284be2
@ -56,10 +56,6 @@ namespace osu.Game.Screens.Backgrounds
|
||||
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
||||
|
||||
AddInternal(seasonalBackgroundLoader);
|
||||
|
||||
// Load first background asynchronously as part of BDL load.
|
||||
currentDisplay = RNG.Next(0, background_count);
|
||||
Next();
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
@ -73,6 +69,9 @@ namespace osu.Game.Screens.Backgrounds
|
||||
introSequence.ValueChanged += _ => Scheduler.AddOnce(next);
|
||||
seasonalBackgroundLoader.SeasonalBackgroundChanged += () => Scheduler.AddOnce(next);
|
||||
|
||||
currentDisplay = RNG.Next(0, background_count);
|
||||
Next();
|
||||
|
||||
// helper function required for AddOnce usage.
|
||||
void next() => Next();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user