mirror of
https://github.com/osukey/osukey.git
synced 2025-08-03 06:36:31 +09:00
Add DoubleTime, HalfTime and Nightcore support.
This commit is contained in:
@ -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.ResetRate();
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user