1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-19 06:32:55 +08:00

Add Base Preview Time

This commit is contained in:
BuildTools 2016-12-15 17:11:48 -06:00
parent 10de34930b
commit a845a897b3

View File

@ -279,20 +279,28 @@ namespace osu.Game.Screens.Select
/// </summary> /// </summary>
private void selectionChanged(BeatmapGroup group, BeatmapInfo beatmap) private void selectionChanged(BeatmapGroup group, BeatmapInfo beatmap)
{ {
bool beatmapSetChange = false;
if (!beatmap.Equals(Beatmap?.BeatmapInfo)) if (!beatmap.Equals(Beatmap?.BeatmapInfo))
{ {
if (beatmap.BeatmapSetID == Beatmap?.BeatmapInfo.BeatmapSetID) if (beatmap.BeatmapSetID == Beatmap?.BeatmapInfo.BeatmapSetID)
{
sampleChangeDifficulty.Play(); sampleChangeDifficulty.Play();
beatmapSetChange = false;
}
else else
{
sampleChangeBeatmap.Play(); sampleChangeBeatmap.Play();
beatmapSetChange = true;
}
Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap); Beatmap = database.GetWorkingBeatmap(beatmap, Beatmap);
} }
ensurePlayingSelected(); ensurePlayingSelected(beatmapSetChange);
} }
private async Task ensurePlayingSelected() private async Task ensurePlayingSelected(bool preview = false)
{ {
AudioTrack track = null; AudioTrack track = null;
@ -303,6 +311,8 @@ namespace osu.Game.Screens.Select
if (track != null) if (track != null)
{ {
trackManager.SetExclusive(track); trackManager.SetExclusive(track);
if (preview)
track.Seek(Beatmap.Beatmap.Metadata.PreviewTime);
track.Start(); track.Start();
} }
}); });