mirror of
https://github.com/ppy/osu
synced 2025-01-01 20:02:14 +00:00
Move seasonalBackgroundMode check up and early return if available
This commit is contained in:
parent
f6eb5680ec
commit
0b46c19b23
@ -79,6 +79,18 @@ namespace osu.Game.Screens.Backgrounds
|
||||
Background newBackground;
|
||||
string backgroundName;
|
||||
|
||||
if (seasonalBackgroundMode.Value == SeasonalBackgroundMode.Always
|
||||
|| seasonalBackgroundMode.Value == SeasonalBackgroundMode.Sometimes && seasonalBackgroundLoader.IsInSeason)
|
||||
{
|
||||
var seasonalBackground = seasonalBackgroundLoader.LoadBackground();
|
||||
|
||||
if (seasonalBackground != null)
|
||||
{
|
||||
seasonalBackground.Depth = currentDisplay;
|
||||
return seasonalBackground;
|
||||
}
|
||||
}
|
||||
|
||||
switch (introSequence.Value)
|
||||
{
|
||||
case IntroSequence.Welcome:
|
||||
@ -106,12 +118,6 @@ namespace osu.Game.Screens.Backgrounds
|
||||
else
|
||||
newBackground = new Background(backgroundName);
|
||||
|
||||
if (seasonalBackgroundMode.Value == SeasonalBackgroundMode.Always
|
||||
|| seasonalBackgroundMode.Value == SeasonalBackgroundMode.Sometimes && seasonalBackgroundLoader.IsInSeason)
|
||||
{
|
||||
newBackground = seasonalBackgroundLoader.LoadBackground() ?? newBackground;
|
||||
}
|
||||
|
||||
newBackground.Depth = currentDisplay;
|
||||
|
||||
return newBackground;
|
||||
|
Loading…
Reference in New Issue
Block a user