mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 20:22:55 +08:00
Implement background switching based on the intro
Only the Welcome intro has its own unique background right now
This commit is contained in:
parent
4bf45ea99a
commit
18e30a7fc4
@ -22,11 +22,12 @@ namespace osu.Game.Screens.Backgrounds
|
||||
private int currentDisplay;
|
||||
private const int background_count = 7;
|
||||
|
||||
private string backgroundName => $@"Menu/menu-background-{currentDisplay % background_count + 1}";
|
||||
private string backgroundName;
|
||||
|
||||
private Bindable<User> user;
|
||||
private Bindable<Skin> skin;
|
||||
private Bindable<BackgroundSource> mode;
|
||||
private Bindable<IntroSequence> introSequence;
|
||||
|
||||
[Resolved]
|
||||
private IBindable<WorkingBeatmap> beatmap { get; set; }
|
||||
@ -42,11 +43,13 @@ namespace osu.Game.Screens.Backgrounds
|
||||
user = api.LocalUser.GetBoundCopy();
|
||||
skin = skinManager.CurrentSkin.GetBoundCopy();
|
||||
mode = config.GetBindable<BackgroundSource>(OsuSetting.MenuBackgroundSource);
|
||||
introSequence = config.GetBindable<IntroSequence>(OsuSetting.IntroSequence);
|
||||
|
||||
user.ValueChanged += _ => Next();
|
||||
skin.ValueChanged += _ => Next();
|
||||
mode.ValueChanged += _ => Next();
|
||||
beatmap.ValueChanged += _ => Next();
|
||||
introSequence.ValueChanged += _ => Next();
|
||||
|
||||
currentDisplay = RNG.Next(0, background_count);
|
||||
|
||||
@ -74,6 +77,17 @@ namespace osu.Game.Screens.Backgrounds
|
||||
{
|
||||
Background newBackground;
|
||||
|
||||
switch (introSequence.Value)
|
||||
{
|
||||
case IntroSequence.Welcome:
|
||||
backgroundName = "Menu/menu-background-welcome";
|
||||
break;
|
||||
|
||||
default:
|
||||
backgroundName = $@"Menu/menu-background-{currentDisplay % background_count + 1}";
|
||||
break;
|
||||
}
|
||||
|
||||
if (user.Value?.IsSupporter ?? false)
|
||||
{
|
||||
switch (mode.Value)
|
||||
|
Loading…
Reference in New Issue
Block a user