1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-12 19:42:55 +08:00

Fix extra hit result types showing on ranking screen

This commit is contained in:
Dean Herbert 2018-12-27 22:31:40 +09:00
parent 12a93af156
commit 99ed009838

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.Linq;
using osu.Framework.Configuration; using osu.Framework.Configuration;
using osu.Framework.Extensions; using osu.Framework.Extensions;
using osu.Framework.Extensions.TypeExtensions; using osu.Framework.Extensions.TypeExtensions;
@ -59,6 +60,11 @@ namespace osu.Game.Rulesets.Scoring
/// </summary> /// </summary>
public readonly BindableInt Combo = new BindableInt(); public readonly BindableInt Combo = new BindableInt();
/// <summary>
/// Create a <see cref="HitWindows"/> for this processor.
/// </summary>
protected virtual HitWindows CreateHitWindows() => new HitWindows();
/// <summary> /// <summary>
/// The current rank. /// The current rank.
/// </summary> /// </summary>
@ -171,12 +177,10 @@ namespace osu.Game.Rulesets.Scoring
score.Rank = Rank; score.Rank = Rank;
score.Date = DateTimeOffset.Now; score.Date = DateTimeOffset.Now;
score.Statistics[HitResult.Perfect] = scoreResultCounts.GetOrDefault(HitResult.Perfect); var hitWindows = CreateHitWindows();
score.Statistics[HitResult.Great] = scoreResultCounts.GetOrDefault(HitResult.Great);
score.Statistics[HitResult.Good] = scoreResultCounts.GetOrDefault(HitResult.Good); foreach (var result in Enum.GetValues(typeof(HitResult)).OfType<HitResult>().Where(r => hitWindows.IsHitResultAllowed(r)))
score.Statistics[HitResult.Ok] = scoreResultCounts.GetOrDefault(HitResult.Ok); score.Statistics[result] = scoreResultCounts.GetOrDefault(result);
score.Statistics[HitResult.Meh] = scoreResultCounts.GetOrDefault(HitResult.Meh);
score.Statistics[HitResult.Miss] = scoreResultCounts.GetOrDefault(HitResult.Miss);
} }
public abstract double GetStandardisedScore(); public abstract double GetStandardisedScore();