2021-05-07 15:26:54 +08:00
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
2022-12-30 22:24:41 +08:00
|
|
|
using System.ComponentModel;
|
2021-05-07 15:26:54 +08:00
|
|
|
using osu.Framework.Allocation;
|
2022-12-30 20:19:46 +08:00
|
|
|
using osu.Framework.Bindables;
|
|
|
|
using osu.Game.Configuration;
|
2021-05-07 15:26:54 +08:00
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
using osu.Game.Rulesets.Scoring;
|
|
|
|
|
|
|
|
namespace osu.Game.Screens.Play.HUD
|
|
|
|
{
|
|
|
|
public abstract partial class GameplayAccuracyCounter : PercentageCounter
|
|
|
|
{
|
2022-12-31 03:30:58 +08:00
|
|
|
[SettingSource("Accuracy display mode", "Which accuracy mode should be displayed.")]
|
|
|
|
public Bindable<AccuracyDisplayMode> AccuracyDisplay { get; } = new Bindable<AccuracyDisplayMode>();
|
2022-12-30 20:19:46 +08:00
|
|
|
|
2022-12-31 04:08:48 +08:00
|
|
|
[Resolved]
|
|
|
|
private ScoreProcessor scoreProcessor { get; set; } = null!;
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
2021-05-07 15:26:54 +08:00
|
|
|
{
|
2022-12-31 04:08:48 +08:00
|
|
|
base.LoadComplete();
|
|
|
|
|
2022-12-30 22:06:10 +08:00
|
|
|
AccuracyDisplay.BindValueChanged(mod =>
|
2022-12-30 20:19:46 +08:00
|
|
|
{
|
|
|
|
Current.UnbindBindings();
|
|
|
|
|
|
|
|
switch (mod.NewValue)
|
|
|
|
{
|
2022-12-31 03:30:58 +08:00
|
|
|
case AccuracyDisplayMode.Standard:
|
2022-12-30 20:19:46 +08:00
|
|
|
Current.BindTo(scoreProcessor.Accuracy);
|
|
|
|
break;
|
|
|
|
|
2022-12-31 03:30:58 +08:00
|
|
|
case AccuracyDisplayMode.MinimumAchievable:
|
|
|
|
Current.BindTo(scoreProcessor.MinimumAccuracy);
|
2022-12-30 20:19:46 +08:00
|
|
|
break;
|
|
|
|
|
2022-12-31 03:30:58 +08:00
|
|
|
case AccuracyDisplayMode.MaximumAchievable:
|
|
|
|
Current.BindTo(scoreProcessor.MaximumAccuracy);
|
2022-12-30 20:19:46 +08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}, true);
|
|
|
|
}
|
|
|
|
|
2022-12-31 03:30:58 +08:00
|
|
|
public enum AccuracyDisplayMode
|
2022-12-30 20:19:46 +08:00
|
|
|
{
|
2022-12-31 03:30:58 +08:00
|
|
|
[Description("Standard")]
|
|
|
|
Standard,
|
2022-12-30 22:24:41 +08:00
|
|
|
|
2022-12-31 03:30:58 +08:00
|
|
|
[Description("Maximum achievable")]
|
|
|
|
MaximumAchievable,
|
2022-12-30 22:24:41 +08:00
|
|
|
|
2022-12-31 03:30:58 +08:00
|
|
|
[Description("Minimum achievable")]
|
|
|
|
MinimumAchievable
|
2021-05-07 15:26:54 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|