mirror of
https://github.com/ppy/osu.git
synced 2025-01-26 18:03:11 +08:00
Fix intros playing incorrectly
This commit is contained in:
parent
2e3ecf71c7
commit
ef689d943a
@ -581,6 +581,8 @@ namespace osu.Game
|
||||
ScreenStack.ScreenPushed += screenPushed;
|
||||
ScreenStack.ScreenExited += screenExited;
|
||||
|
||||
loadComponentSingleFile(MusicController, Add);
|
||||
|
||||
loadComponentSingleFile(osuLogo, logo =>
|
||||
{
|
||||
logoContainer.Add(logo);
|
||||
@ -602,8 +604,6 @@ namespace osu.Game
|
||||
|
||||
loadComponentSingleFile(new OnScreenDisplay(), Add, true);
|
||||
|
||||
loadComponentSingleFile(MusicController, Add);
|
||||
|
||||
loadComponentSingleFile(notifications.With(d =>
|
||||
{
|
||||
d.GetToolbarHeight = () => ToolbarOffset;
|
||||
|
@ -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);
|
||||
|
@ -59,7 +59,7 @@ namespace osu.Game.Screens.Menu
|
||||
LoadComponentAsync(new TrianglesIntroSequence(logo, background)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
Clock = new FramedClock(UsingThemedIntro ? MusicController.CurrentTrack : null),
|
||||
Clock = new FramedClock(UsingThemedIntro ? (IAdjustableClock)Track : null),
|
||||
LoadMenu = LoadMenu
|
||||
}, t =>
|
||||
{
|
||||
|
@ -11,7 +11,6 @@ using osu.Framework.Graphics.Containers;
|
||||
using osu.Framework.Graphics.Shapes;
|
||||
using osu.Framework.Graphics.Sprites;
|
||||
using osu.Framework.Graphics.Textures;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Screens.Backgrounds;
|
||||
using osuTK.Graphics;
|
||||
|
||||
@ -31,9 +30,6 @@ namespace osu.Game.Screens.Menu
|
||||
Alpha = 0,
|
||||
};
|
||||
|
||||
[Resolved]
|
||||
private MusicController musicController { get; set; }
|
||||
|
||||
private BackgroundScreenDefault background;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
@ -43,9 +39,6 @@ namespace osu.Game.Screens.Menu
|
||||
welcome = audio.Samples.Get(@"Intro/Welcome/welcome");
|
||||
|
||||
pianoReverb = audio.Samples.Get(@"Intro/Welcome/welcome_piano");
|
||||
|
||||
if (musicController.CurrentTrack != null)
|
||||
musicController.CurrentTrack.Looping = true;
|
||||
}
|
||||
|
||||
protected override void LogoArriving(OsuLogo logo, bool resuming)
|
||||
@ -54,6 +47,8 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
if (!resuming)
|
||||
{
|
||||
Track.Looping = true;
|
||||
|
||||
LoadComponentAsync(new WelcomeIntroSequence
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both
|
||||
|
Loading…
Reference in New Issue
Block a user