Skip to content

Commit

Permalink
Fix: bpm values not scaling with mods=dt / ht search modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
Piotrekol committed Jul 15, 2022
1 parent 0990e6d commit 39a24ee
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class DifficultyCalculatorResult
public float Hp { get; set; }
public double MinBpm { get; set; }
public double MaxBpm { get; set; }
public double BpmMultiplier { get; set; }
}
readonly float od0_ms = 79.5f,
od10_ms = 19.5f,
Expand All @@ -36,6 +37,7 @@ public DifficultyCalculatorResult ApplyMods(Beatmap map, Mods mods, DifficultyCa
result.Hp = map.HpDrainRate;
result.MinBpm = map.MinBpm;
result.MaxBpm = map.MaxBpm;
result.BpmMultiplier = 1;

if ((mods & Mods.MapChanging) == 0)
{
Expand Down Expand Up @@ -75,7 +77,7 @@ public DifficultyCalculatorResult ApplyMods(Beatmap map, Mods mods, DifficultyCa

result.MinBpm *= modifier;
result.MaxBpm *= modifier;

result.BpmMultiplier = modifier;
//ar
float ar_multiplier = 1;

Expand Down
8 changes: 8 additions & 0 deletions GuiComponents/Controls/BeatmapListingView.cs
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ private void InitListView()
var val = (DateTime)cellValue;
return val > d ? $"{val}" : "Never";
};
MainBpm.AspectGetter = rowObject =>
{
if (rowObject is Beatmap beatmap)
{
return beatmap.MainBpm * _difficultyCalculator.ApplyMods(beatmap, _currentMods).BpmMultiplier;
}
return null;
};
MainBpm.AspectToStringConverter = delegate (object cellValue)
{
if (cellValue == null) return string.Empty;
Expand Down

0 comments on commit 39a24ee

Please sign in to comment.