Fix intros playing incorrectly

This commit is contained in:
smoogipoo
2020-08-06 18:54:08 +09:00
parent 2e3ecf71c7
commit ef689d943a
4 changed files with 12 additions and 16 deletions

View File

@ -44,8 +44,7 @@ namespace osu.Game.Screens.Menu
private WorkingBeatmap initialBeatmap;
[Resolved]
protected MusicController MusicController { get; private set; }
protected ITrack Track { get; private set; }
private readonly BindableDouble exitingVolumeFade = new BindableDouble(1);
@ -62,6 +61,9 @@ namespace osu.Game.Screens.Menu
[Resolved]
private AudioManager audio { get; set; }
[Resolved]
private MusicController musicController { get; set; }
/// <summary>
/// Whether the <see cref="Track"/> is provided by osu! resources, rather than a user beatmap.
/// </summary>
@ -113,9 +115,7 @@ namespace osu.Game.Screens.Menu
if (setInfo != null)
{
initialBeatmap = beatmaps.GetWorkingBeatmap(setInfo.Beatmaps[0]);
// Todo: Wrong.
UsingThemedIntro = MusicController.CurrentTrack?.IsDummyDevice == false;
UsingThemedIntro = initialBeatmap.GetRealTrack().IsDummyDevice == false;
}
return UsingThemedIntro;
@ -154,7 +154,7 @@ 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)
MusicController.Play(true);
Track.Restart();
}
protected override void LogoArriving(OsuLogo logo, bool resuming)
@ -168,6 +168,7 @@ namespace osu.Game.Screens.Menu
if (!resuming)
{
beatmap.Value = initialBeatmap;
Track = musicController.CurrentTrack;
logo.MoveTo(new Vector2(0.5f));
logo.ScaleTo(Vector2.One);