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.
|
|
|
|
|
|
|
|
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
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
public abstract partial class GameplayAccuracyCounter : PercentageCounter
|
2021-05-07 15:26:54 +08:00
|
|
|
{
|
2022-12-30 20:19:46 +08:00
|
|
|
[SettingSource("Accuracy Display Mode")]
|
2022-12-30 22:06:10 +08:00
|
|
|
public Bindable<AccuracyType> AccuracyDisplay { get; } = new Bindable<AccuracyType>();
|
2022-12-30 20:19:46 +08:00
|
|
|
|
2021-05-07 15:26:54 +08:00
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(ScoreProcessor scoreProcessor)
|
|
|
|
{
|
2022-12-30 22:06:10 +08:00
|
|
|
AccuracyDisplay.BindValueChanged(mod =>
|
2022-12-30 20:19:46 +08:00
|
|
|
{
|
|
|
|
Current.UnbindBindings();
|
|
|
|
|
|
|
|
switch (mod.NewValue)
|
|
|
|
{
|
|
|
|
case AccuracyType.Current:
|
|
|
|
Current.BindTo(scoreProcessor.Accuracy);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AccuracyType.Increase:
|
|
|
|
Current.BindTo(scoreProcessor.IncreaseAccuracy);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case AccuracyType.Decrease:
|
|
|
|
Current.BindTo(scoreProcessor.DecreaseAccuracy);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}, true);
|
|
|
|
}
|
|
|
|
|
|
|
|
public enum AccuracyType
|
|
|
|
{
|
|
|
|
Current,
|
|
|
|
Increase,
|
|
|
|
Decrease
|
2021-05-07 15:26:54 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|