diff --git a/plugins/BeatmapPpReplacements/PpReplacements.cs b/plugins/BeatmapPpReplacements/PpReplacements.cs index 44cd7f2e..617bf566 100644 --- a/plugins/BeatmapPpReplacements/PpReplacements.cs +++ b/plugins/BeatmapPpReplacements/PpReplacements.cs @@ -140,7 +140,7 @@ private double GetPp(CancellationToken cancellationToken, IPpCalculator ppCalcul _ppCalculator.Mods = mods.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); - return ppCalculator.Calculate(cancellationToken); + return Math.Round(ppCalculator.Calculate(cancellationToken), 3); } } } \ No newline at end of file diff --git a/plugins/OsuMemoryEventSource/InterpolatedValue.cs b/plugins/OsuMemoryEventSource/InterpolatedValue.cs index 918bc109..edb87253 100644 --- a/plugins/OsuMemoryEventSource/InterpolatedValue.cs +++ b/plugins/OsuMemoryEventSource/InterpolatedValue.cs @@ -6,11 +6,21 @@ public enum InterpolationType { Linear, EaseIn, EaseOutQuint } - public class InterpolatedValue + + public class RoundedInterpolatedValue : InterpolatedValue { + public int DecimalPlaces { get; set; } = 3; + public override double Current => Math.Round(base.Current, DecimalPlaces); + + public RoundedInterpolatedValue(double speed) : base(speed) + { + } + } + public class InterpolatedValue + { public InterpolationType InterpolationType { get; set; } = InterpolationType.EaseOutQuint; - public double Current { get; private set; } = 0; + public virtual double Current { get; private set; } = 0; private double _orginalValue = 0; private double _finalValue = 0; private double _transitionSpeed; diff --git a/plugins/OsuMemoryEventSource/MemoryDataProcessor.cs b/plugins/OsuMemoryEventSource/MemoryDataProcessor.cs index 883b5420..b9608ff8 100644 --- a/plugins/OsuMemoryEventSource/MemoryDataProcessor.cs +++ b/plugins/OsuMemoryEventSource/MemoryDataProcessor.cs @@ -77,7 +77,7 @@ private enum InterpolatedValueName private ManualResetEvent _notUpdatingMemoryValues = new ManualResetEvent(true); private ManualResetEvent _newPlayStarted = new ManualResetEvent(true); - private readonly Dictionary InterpolatedValues = new Dictionary(); + private readonly Dictionary InterpolatedValues = new(); private CancellationTokenSource cancellationTokenSource = new CancellationTokenSource(); public EventHandler TokensUpdated { get; set; } public bool IsMainProcessor { get; private set; } @@ -91,7 +91,7 @@ public MemoryDataProcessor(ISettings settings, IContextAwareLogger logger, IModP _modParser = modParser; foreach (var v in (InterpolatedValueName[])Enum.GetValues(typeof(InterpolatedValueName))) { - InterpolatedValues.Add(v, new InterpolatedValue(0.15)); + InterpolatedValues.Add(v, new RoundedInterpolatedValue(0.15)); } ToggleSmoothing(true);