Merge branch 'master' into nodal-hit-sounds

This commit is contained in:
Dan Balasescu
2017-04-22 22:11:19 +09:00
committed by GitHub
40 changed files with 924 additions and 666 deletions

View File

@ -8,6 +8,7 @@ using osu.Game.Database;
using osu.Game.Rulesets.Mods;
using System;
using System.Collections.Generic;
using System.Linq;
namespace osu.Game.Beatmaps
{
@ -26,6 +27,18 @@ namespace osu.Game.Beatmaps
BeatmapInfo = beatmapInfo;
BeatmapSetInfo = beatmapSetInfo;
WithStoryboard = withStoryboard;
Mods.ValueChanged += mods => applyRateAdjustments();
}
private void applyRateAdjustments()
{
var t = track;
if (t == null) return;
t.ResetSpeedAdjustments();
foreach (var mod in Mods.Value.OfType<IApplicableToClock>())
mod.ApplyToClock(t);
}
protected abstract Beatmap GetBeatmap();
@ -66,7 +79,11 @@ namespace osu.Game.Beatmaps
{
lock (trackLock)
{
return track ?? (track = GetTrack());
if (track != null) return track;
track = GetTrack();
applyRateAdjustments();
return track;
}
}
}