mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
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:
@ -383,10 +383,18 @@ namespace osu.Game.Screens.Select
|
|||||||
return labels.ToArray();
|
return labels.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Resolved]
|
||||||
|
private IBindable<IReadOnlyList<Mod>> mods { get; set; }
|
||||||
|
|
||||||
private string getBPMRange(IBeatmap beatmap)
|
private string getBPMRange(IBeatmap beatmap)
|
||||||
{
|
{
|
||||||
double bpmMax = beatmap.ControlPointInfo.BPMMaximum;
|
// this doesn't consider mods which apply variable rates, yet.
|
||||||
double bpmMin = beatmap.ControlPointInfo.BPMMinimum;
|
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))
|
if (Precision.AlmostEquals(bpmMin, bpmMax))
|
||||||
return $"{bpmMin:0}";
|
return $"{bpmMin:0}";
|
||||||
|
Reference in New Issue
Block a user