mirror of
https://github.com/ppy/osu.git
synced 2025-02-14 04:03:22 +08:00
Merge pull request #19812 from peppy/improve-intro-timings-2
Tweak intro timings more and ensure non-theme tracks play from preview point
This commit is contained in:
commit
aaaaff1bbf
@ -134,6 +134,6 @@ namespace osu.Game.Beatmaps
|
||||
/// <summary>
|
||||
/// Reads the correct track restart point from beatmap metadata and sets looping to enabled.
|
||||
/// </summary>
|
||||
void PrepareTrackForPreviewLooping();
|
||||
void PrepareTrackForPreview(bool looping);
|
||||
}
|
||||
}
|
||||
|
@ -110,9 +110,9 @@ namespace osu.Game.Beatmaps
|
||||
|
||||
public Track LoadTrack() => track = GetBeatmapTrack() ?? GetVirtualTrack(1000);
|
||||
|
||||
public void PrepareTrackForPreviewLooping()
|
||||
public void PrepareTrackForPreview(bool looping)
|
||||
{
|
||||
Track.Looping = true;
|
||||
Track.Looping = looping;
|
||||
Track.RestartPoint = Metadata.PreviewTime;
|
||||
|
||||
if (Track.RestartPoint == -1)
|
||||
|
@ -19,11 +19,9 @@ namespace osu.Game.Screens.Menu
|
||||
|
||||
protected override string BeatmapFile => "circles.osz";
|
||||
|
||||
public const double TRACK_START_DELAY_NON_THEMED = 1000;
|
||||
private const double track_start_delay_themed = 600;
|
||||
public const double TRACK_START_DELAY = 600;
|
||||
|
||||
private const double delay_for_menu = 2900;
|
||||
private const double delay_step_one = 2300;
|
||||
|
||||
private Sample welcome;
|
||||
|
||||
@ -47,16 +45,14 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
welcome?.Play();
|
||||
|
||||
double trackStartDelay = UsingThemedIntro ? track_start_delay_themed : TRACK_START_DELAY_NON_THEMED;
|
||||
|
||||
Scheduler.AddDelayed(delegate
|
||||
{
|
||||
StartTrack();
|
||||
|
||||
PrepareMenuLoad();
|
||||
|
||||
Scheduler.AddDelayed(LoadMenu, delay_for_menu - trackStartDelay);
|
||||
}, trackStartDelay);
|
||||
Scheduler.AddDelayed(LoadMenu, delay_for_menu - TRACK_START_DELAY);
|
||||
}, TRACK_START_DELAY);
|
||||
|
||||
logo.ScaleTo(1);
|
||||
logo.FadeIn();
|
||||
|
@ -276,12 +276,17 @@ namespace osu.Game.Screens.Menu
|
||||
{
|
||||
var drawableTrack = musicController.CurrentTrack;
|
||||
|
||||
drawableTrack.Start();
|
||||
|
||||
if (!UsingThemedIntro)
|
||||
{
|
||||
drawableTrack.VolumeTo(0).Then()
|
||||
.VolumeTo(1, 2000, Easing.OutQuint);
|
||||
initialBeatmap?.PrepareTrackForPreview(false);
|
||||
|
||||
drawableTrack.VolumeTo(0);
|
||||
drawableTrack.Restart();
|
||||
drawableTrack.VolumeTo(1, 2200, Easing.InCubic);
|
||||
}
|
||||
else
|
||||
{
|
||||
drawableTrack.Restart();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -88,7 +88,7 @@ namespace osu.Game.Screens.Menu
|
||||
// If the user has requested no theme, fallback to the same intro voice and delay as IntroCircles.
|
||||
// The triangles intro voice and theme are combined which makes it impossible to use.
|
||||
welcome?.Play();
|
||||
Scheduler.AddDelayed(StartTrack, IntroCircles.TRACK_START_DELAY_NON_THEMED);
|
||||
Scheduler.AddDelayed(StartTrack, IntroCircles.TRACK_START_DELAY);
|
||||
}
|
||||
else
|
||||
StartTrack();
|
||||
|
@ -192,7 +192,7 @@ namespace osu.Game.Screens.Menu
|
||||
// presume the track is the current beatmap's track. not sure how correct this assumption is but it has worked until now.
|
||||
if (!track.IsRunning)
|
||||
{
|
||||
Beatmap.Value.PrepareTrackForPreviewLooping();
|
||||
Beatmap.Value.PrepareTrackForPreview(false);
|
||||
track.Restart();
|
||||
}
|
||||
}
|
||||
|
@ -485,7 +485,7 @@ namespace osu.Game.Screens.OnlinePlay.Match
|
||||
|
||||
if (track != null)
|
||||
{
|
||||
Beatmap.Value.PrepareTrackForPreviewLooping();
|
||||
Beatmap.Value.PrepareTrackForPreview(true);
|
||||
music?.EnsurePlayingSomething();
|
||||
}
|
||||
}
|
||||
|
@ -683,7 +683,7 @@ namespace osu.Game.Screens.Select
|
||||
}
|
||||
|
||||
private void ensureTrackLooping(IWorkingBeatmap beatmap, TrackChangeDirection changeDirection)
|
||||
=> beatmap.PrepareTrackForPreviewLooping();
|
||||
=> beatmap.PrepareTrackForPreview(true);
|
||||
|
||||
public override bool OnBackButton()
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user