Merge branch 'master' into game-overlay-activation-mode

This commit is contained in:
Dan Balasescu
2020-09-03 13:34:22 +09:00
committed by GitHub
132 changed files with 1490 additions and 717 deletions

View File

@ -5,7 +5,6 @@ using System.Linq;
using osuTK;
using osuTK.Graphics;
using osu.Framework.Allocation;
using osu.Framework.Audio.Track;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Platform;
@ -46,8 +45,8 @@ namespace osu.Game.Screens.Menu
[Resolved]
private GameHost host { get; set; }
[Resolved(canBeNull: true)]
private MusicController music { get; set; }
[Resolved]
private MusicController musicController { get; set; }
[Resolved(canBeNull: true)]
private LoginOverlay login { get; set; }
@ -62,8 +61,6 @@ namespace osu.Game.Screens.Menu
protected override BackgroundScreen CreateBackground() => background;
internal Track Track { get; private set; }
private Bindable<float> holdDelay;
private Bindable<bool> loginDisplayed;
@ -177,15 +174,14 @@ namespace osu.Game.Screens.Menu
base.OnEntering(last);
buttons.FadeInFromZero(500);
Track = Beatmap.Value.Track;
var metadata = Beatmap.Value.Metadata;
if (last is IntroScreen && Track != null)
if (last is IntroScreen && musicController.TrackLoaded)
{
if (!Track.IsRunning)
if (!musicController.CurrentTrack.IsRunning)
{
Track.Seek(metadata.PreviewTime != -1 ? metadata.PreviewTime : 0.4f * Track.Length);
Track.Start();
musicController.CurrentTrack.Seek(metadata.PreviewTime != -1 ? metadata.PreviewTime : 0.4f * musicController.CurrentTrack.Length);
musicController.CurrentTrack.Start();
}
}
@ -260,7 +256,7 @@ namespace osu.Game.Screens.Menu
// we may have consumed our preloaded instance, so let's make another.
preloadSongSelect();
music.EnsurePlayingSomething();
musicController.EnsurePlayingSomething();
}
public override bool OnExiting(IScreen next)