Ensure that all changes to screen backgrounds are on the correct thread

This commit is contained in:
Dean Herbert
2021-01-04 18:32:23 +09:00
parent a3e4e2f6c3
commit b3f08b29ca
12 changed files with 132 additions and 60 deletions

View File

@ -127,11 +127,11 @@ namespace osu.Game.Screens.Menu
{
case ButtonSystemState.Initial:
case ButtonSystemState.Exit:
Background.FadeColour(Color4.White, 500, Easing.OutSine);
ApplyToBackground(b => b.FadeColour(Color4.White, 500, Easing.OutSine));
break;
default:
Background.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine);
ApplyToBackground(b => b.FadeColour(OsuColour.Gray(0.8f), 500, Easing.OutSine));
break;
}
};
@ -256,7 +256,7 @@ namespace osu.Game.Screens.Menu
{
base.OnResuming(last);
(Background as BackgroundScreenDefault)?.Next();
ApplyToBackground(b => (b as BackgroundScreenDefault)?.Next());
// we may have consumed our preloaded instance, so let's make another.
preloadSongSelect();