mirror of https://github.com/ppy/osu
Update the displayed BPM at song select with rate adjust mods
This only covers constant rate rate adjust mods. Mods like wind up/wind down will need a more complex implementation which we haven't really planned yet.
This commit is contained in:
parent
a9aed0eef4
commit
31c52bd585
|
@ -383,10 +383,18 @@ private InfoLabel[] getInfoLabels()
|
|||
return labels.ToArray();
|
||||
}
|
||||
|
||||
[Resolved]
|
||||
private IBindable<IReadOnlyList<Mod>> mods { get; set; }
|
||||
|
||||
private string getBPMRange(IBeatmap beatmap)
|
||||
{
|
||||
double bpmMax = beatmap.ControlPointInfo.BPMMaximum;
|
||||
double bpmMin = beatmap.ControlPointInfo.BPMMinimum;
|
||||
// this doesn't consider mods which apply variable rates, yet.
|
||||
double rate = 1;
|
||||
foreach (var mod in mods.Value.OfType<IApplicableToRate>())
|
||||
rate = mod.ApplyToRate(0, rate);
|
||||
|
||||
double bpmMax = beatmap.ControlPointInfo.BPMMaximum * rate;
|
||||
double bpmMin = beatmap.ControlPointInfo.BPMMinimum * rate;
|
||||
|
||||
if (Precision.AlmostEquals(bpmMin, bpmMax))
|
||||
return $"{bpmMin:0}";
|
||||
|
|
Loading…
Reference in New Issue