mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 04:12:55 +08: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;
|
Background newBackground;
|
||||||
string backgroundName;
|
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)
|
switch (introSequence.Value)
|
||||||
{
|
{
|
||||||
case IntroSequence.Welcome:
|
case IntroSequence.Welcome:
|
||||||
@ -106,12 +118,6 @@ namespace osu.Game.Screens.Backgrounds
|
|||||||
else
|
else
|
||||||
newBackground = new Background(backgroundName);
|
newBackground = new Background(backgroundName);
|
||||||
|
|
||||||
if (seasonalBackgroundMode.Value == SeasonalBackgroundMode.Always
|
|
||||||
|| seasonalBackgroundMode.Value == SeasonalBackgroundMode.Sometimes && seasonalBackgroundLoader.IsInSeason)
|
|
||||||
{
|
|
||||||
newBackground = seasonalBackgroundLoader.LoadBackground() ?? newBackground;
|
|
||||||
}
|
|
||||||
|
|
||||||
newBackground.Depth = currentDisplay;
|
newBackground.Depth = currentDisplay;
|
||||||
|
|
||||||
return newBackground;
|
return newBackground;
|
||||||
|
Loading…
Reference in New Issue
Block a user