1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 12:33:01 +08:00

Add the option to loop the intro in the main menu

This commit is contained in:
Shivam 2020-06-29 00:39:49 +02:00
parent 6547e07e56
commit ffbce61ca8
3 changed files with 11 additions and 0 deletions

View File

@ -55,6 +55,7 @@ namespace osu.Game.Configuration
Set(OsuSetting.VolumeInactive, 0.25, 0, 1, 0.01);
Set(OsuSetting.MenuVoice, true);
Set(OsuSetting.MenuMusicLoop, true);
Set(OsuSetting.MenuMusic, true);
Set(OsuSetting.AudioOffset, 0, -500.0, 500.0, 1);
@ -191,6 +192,7 @@ namespace osu.Game.Configuration
AudioOffset,
VolumeInactive,
MenuMusic,
MenuMusicLoop,
MenuVoice,
CursorRotation,
MenuParallax,

View File

@ -28,6 +28,11 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
LabelText = "osu! music theme",
Bindable = config.GetBindable<bool>(OsuSetting.MenuMusic)
},
new SettingsCheckbox
{
LabelText = "loop the music theme",
Bindable = config.GetBindable<bool>(OsuSetting.MenuMusicLoop)
},
new SettingsDropdown<IntroSequence>
{
LabelText = "Intro sequence",

View File

@ -40,6 +40,7 @@ namespace osu.Game.Screens.Menu
protected IBindable<bool> MenuVoice { get; private set; }
protected IBindable<bool> MenuMusic { get; private set; }
private IBindable<bool> menuMusicLoop { get; set; }
private WorkingBeatmap initialBeatmap;
@ -73,6 +74,7 @@ namespace osu.Game.Screens.Menu
MenuVoice = config.GetBindable<bool>(OsuSetting.MenuVoice);
MenuMusic = config.GetBindable<bool>(OsuSetting.MenuMusic);
menuMusicLoop = config.GetBindable<bool>(OsuSetting.MenuMusicLoop);
seeya = audio.Samples.Get(SeeyaSampleName);
@ -152,6 +154,8 @@ namespace osu.Game.Screens.Menu
// Only start the current track if it is the menu music. A beatmap's track is started when entering the Main Menu.
if (UsingThemedIntro)
Track.Restart();
if (menuMusicLoop.Value)
Track.Looping = true;
}
protected override void LogoArriving(OsuLogo logo, bool resuming)