1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +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:
Dan Balasescu 2024-05-01 04:23:27 +09:00 committed by GitHub
commit ff91284be2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();
}