mirror of
https://github.com/ppy/osu
synced 2025-01-12 00:59:35 +00:00
Fix BackgroundScreenDefault
incorrectly updating current background after being inactive
If the beatmap was changed but then reverted to the previously displayed map, the background may have displayed incorrectly on resuming. Closes #15804.
This commit is contained in:
parent
25a056dfad
commit
8c6f50ddb1
@ -48,16 +48,19 @@ namespace osu.Game.Screens.Backgrounds
|
||||
|
||||
AddInternal(seasonalBackgroundLoader);
|
||||
|
||||
user.ValueChanged += _ => Next();
|
||||
skin.ValueChanged += _ => Next();
|
||||
mode.ValueChanged += _ => Next();
|
||||
beatmap.ValueChanged += _ => Next();
|
||||
introSequence.ValueChanged += _ => Next();
|
||||
seasonalBackgroundLoader.SeasonalBackgroundChanged += () => Next();
|
||||
user.ValueChanged += _ => Scheduler.AddOnce(loadNextIfRequired);
|
||||
skin.ValueChanged += _ => Scheduler.AddOnce(loadNextIfRequired);
|
||||
mode.ValueChanged += _ => Scheduler.AddOnce(loadNextIfRequired);
|
||||
beatmap.ValueChanged += _ => Scheduler.AddOnce(loadNextIfRequired);
|
||||
introSequence.ValueChanged += _ => Scheduler.AddOnce(loadNextIfRequired);
|
||||
seasonalBackgroundLoader.SeasonalBackgroundChanged += () => Scheduler.AddOnce(loadNextIfRequired);
|
||||
|
||||
currentDisplay = RNG.Next(0, background_count);
|
||||
|
||||
Next();
|
||||
|
||||
// helper function required for AddOnce usage.
|
||||
void loadNextIfRequired() => Next();
|
||||
}
|
||||
|
||||
private ScheduledDelegate nextTask;
|
||||
|
Loading…
Reference in New Issue
Block a user