1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-19 07:42:58 +08:00

Don't play transition if audio equals.

This commit is contained in:
Huo Yaoyuan 2016-11-07 21:58:30 +08:00
parent c59cad2478
commit dc347a74f5

View File

@ -212,8 +212,9 @@ namespace osu.Game.Overlays
private void workingChanged(object sender = null, EventArgs e = null) private void workingChanged(object sender = null, EventArgs e = null)
{ {
if (beatmapSource.Value == current) return; if (beatmapSource.Value == current) return;
bool audioEquals = current?.BeatmapInfo.AudioEquals(beatmapSource.Value.BeatmapInfo) ?? false;
current = beatmapSource.Value; current = beatmapSource.Value;
updateCurrent(current, true); updateDisplay(current, audioEquals ? null : (bool?)true);
appendToHistory(current.BeatmapInfo); appendToHistory(current.BeatmapInfo);
} }
@ -257,10 +258,10 @@ namespace osu.Game.Overlays
current.Track.Start(); current.Track.Start();
beatmapSource.Value = current; beatmapSource.Value = current;
}); });
updateCurrent(current, isNext); updateDisplay(current, isNext);
} }
private void updateCurrent(WorkingBeatmap beatmap, bool isNext) private void updateDisplay(WorkingBeatmap beatmap, bool? isNext)
{ {
BeatmapMetadata metadata = beatmap.Beatmap.Metadata; BeatmapMetadata metadata = beatmap.Beatmap.Metadata;
title.Text = metadata.TitleUnicode ?? metadata.Title; title.Text = metadata.TitleUnicode ?? metadata.Title;
@ -270,13 +271,13 @@ namespace osu.Game.Overlays
Add(newBackground); Add(newBackground);
if (isNext) if (isNext == true)
{ {
newBackground.Position = new Vector2(400, 0); newBackground.Position = new Vector2(400, 0);
newBackground.MoveToX(0, 500, EasingTypes.OutCubic); newBackground.MoveToX(0, 500, EasingTypes.OutCubic);
backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic); backgroundSprite.MoveToX(-400, 500, EasingTypes.OutCubic);
} }
else else if (isNext == false)
{ {
newBackground.Position = new Vector2(-400, 0); newBackground.Position = new Vector2(-400, 0);
newBackground.MoveToX(0, 500, EasingTypes.OutCubic); newBackground.MoveToX(0, 500, EasingTypes.OutCubic);