mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 05:53:10 +08:00
Rename all "KeysPerSecond" usages to "ClicksPerSecond"
This commit is contained in:
parent
9dc806506e
commit
2aa3a1b50d
@ -19,16 +19,16 @@ using osu.Game.Rulesets.Objects;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD.KeysPerSecond;
|
||||
using osu.Game.Screens.Play.HUD.ClicksPerSecond;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
public class TestSceneKeysPerSecond : OsuTestScene
|
||||
public class TestSceneClicksPerSecond : OsuTestScene
|
||||
{
|
||||
private DependencyProvidingContainer? dependencyContainer;
|
||||
private MockFrameStableClock? mainClock;
|
||||
private KeysPerSecondCalculator? calculator;
|
||||
private ClicksPerSecondCalculator? calculator;
|
||||
private ManualInputListener? listener;
|
||||
|
||||
[SetUpSteps]
|
||||
@ -61,12 +61,12 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
{
|
||||
dependencyContainer!.Children = new Drawable[]
|
||||
{
|
||||
calculator = new KeysPerSecondCalculator(),
|
||||
calculator = new ClicksPerSecondCalculator(),
|
||||
new DependencyProvidingContainer
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both,
|
||||
CachedDependencies = new (Type, object)[] { (typeof(KeysPerSecondCalculator), calculator) },
|
||||
Child = new KeysPerSecondCounter // For visual debugging, has no real purpose in the tests
|
||||
CachedDependencies = new (Type, object)[] { (typeof(ClicksPerSecondCalculator), calculator) },
|
||||
Child = new ClicksPerSecondCounter // For visual debugging, has no real purpose in the tests
|
||||
{
|
||||
Anchor = Anchor.Centre,
|
||||
Origin = Anchor.Centre,
|
||||
@ -204,11 +204,11 @@ namespace osu.Game.Tests.Visual.Gameplay
|
||||
|
||||
#region Mock classes
|
||||
|
||||
private class ManualInputListener : KeysPerSecondCalculator.InputListener
|
||||
private class ManualInputListener : ClicksPerSecondCalculator.InputListener
|
||||
{
|
||||
public void AddInput() => Calculator.AddTimestamp();
|
||||
|
||||
public ManualInputListener(KeysPerSecondCalculator calculator)
|
||||
public ManualInputListener(ClicksPerSecondCalculator calculator)
|
||||
: base(calculator)
|
||||
{
|
||||
}
|
@ -30,7 +30,7 @@ using osu.Game.Rulesets.Objects.Drawables;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD.KeysPerSecond;
|
||||
using osu.Game.Screens.Play.HUD.ClicksPerSecond;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Rulesets.UI
|
||||
@ -341,7 +341,7 @@ namespace osu.Game.Rulesets.UI
|
||||
public void Attach(KeyCounterDisplay keyCounter) =>
|
||||
(KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(keyCounter);
|
||||
|
||||
public void Attach(KeysPerSecondCalculator calculator) => (KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(calculator);
|
||||
public void Attach(ClicksPerSecondCalculator calculator) => (KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(calculator);
|
||||
|
||||
/// <summary>
|
||||
/// Creates a key conversion input manager. An exception will be thrown if a valid <see cref="RulesetInputManager{T}"/> is not returned.
|
||||
|
@ -20,7 +20,7 @@ using osu.Game.Input.Bindings;
|
||||
using osu.Game.Input.Handlers;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Screens.Play;
|
||||
using osu.Game.Screens.Play.HUD.KeysPerSecond;
|
||||
using osu.Game.Screens.Play.HUD.ClicksPerSecond;
|
||||
using static osu.Game.Input.Handlers.ReplayInputHandler;
|
||||
|
||||
namespace osu.Game.Rulesets.UI
|
||||
@ -189,7 +189,7 @@ namespace osu.Game.Rulesets.UI
|
||||
|
||||
#region Keys per second Counter Attachment
|
||||
|
||||
public void Attach(KeysPerSecondCalculator calculator)
|
||||
public void Attach(ClicksPerSecondCalculator calculator)
|
||||
{
|
||||
if (calculator == null) return;
|
||||
|
||||
@ -200,7 +200,7 @@ namespace osu.Game.Rulesets.UI
|
||||
calculator.Listener = listener;
|
||||
}
|
||||
|
||||
public class ActionListener : KeysPerSecondCalculator.InputListener, IKeyBindingHandler<T>
|
||||
public class ActionListener : ClicksPerSecondCalculator.InputListener, IKeyBindingHandler<T>
|
||||
{
|
||||
public bool OnPressed(KeyBindingPressEvent<T> e)
|
||||
{
|
||||
@ -213,7 +213,7 @@ namespace osu.Game.Rulesets.UI
|
||||
{
|
||||
}
|
||||
|
||||
public ActionListener(KeysPerSecondCalculator calculator)
|
||||
public ActionListener(ClicksPerSecondCalculator calculator)
|
||||
: base(calculator)
|
||||
{
|
||||
}
|
||||
@ -262,7 +262,7 @@ namespace osu.Game.Rulesets.UI
|
||||
public interface ICanAttachKeyCounter
|
||||
{
|
||||
void Attach(KeyCounterDisplay keyCounter);
|
||||
void Attach(KeysPerSecondCalculator calculator);
|
||||
void Attach(ClicksPerSecondCalculator calculator);
|
||||
}
|
||||
|
||||
public class RulesetInputManagerInputState<T> : InputState
|
||||
|
@ -9,9 +9,9 @@ using osu.Framework.Graphics;
|
||||
using osu.Framework.Timing;
|
||||
using osu.Game.Rulesets.UI;
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD.KeysPerSecond
|
||||
namespace osu.Game.Screens.Play.HUD.ClicksPerSecond
|
||||
{
|
||||
public class KeysPerSecondCalculator : Component
|
||||
public class ClicksPerSecondCalculator : Component
|
||||
{
|
||||
private readonly List<double> timestamps;
|
||||
|
||||
@ -56,7 +56,7 @@ namespace osu.Game.Screens.Play.HUD.KeysPerSecond
|
||||
public bool Ready => workingClock != null && gameplayClock != null && listener != null;
|
||||
public int Value => timestamps.Count(isTimestampWithinSpan);
|
||||
|
||||
public KeysPerSecondCalculator()
|
||||
public ClicksPerSecondCalculator()
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
timestamps = new List<double>();
|
||||
@ -91,9 +91,9 @@ namespace osu.Game.Screens.Play.HUD.KeysPerSecond
|
||||
|
||||
public abstract class InputListener : Component
|
||||
{
|
||||
protected KeysPerSecondCalculator Calculator;
|
||||
protected ClicksPerSecondCalculator Calculator;
|
||||
|
||||
protected InputListener(KeysPerSecondCalculator calculator)
|
||||
protected InputListener(ClicksPerSecondCalculator calculator)
|
||||
{
|
||||
RelativeSizeAxes = Axes.Both;
|
||||
Depth = float.MinValue;
|
@ -13,27 +13,27 @@ using osu.Game.Graphics.UserInterface;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Play.HUD.KeysPerSecond
|
||||
namespace osu.Game.Screens.Play.HUD.ClicksPerSecond
|
||||
{
|
||||
public class KeysPerSecondCounter : RollingCounter<int>, ISkinnableDrawable
|
||||
public class ClicksPerSecondCounter : RollingCounter<int>, ISkinnableDrawable
|
||||
{
|
||||
private const float alpha_when_invalid = 0.3f;
|
||||
|
||||
private readonly Bindable<bool> valid = new Bindable<bool>();
|
||||
|
||||
private KeysPerSecondCalculator? calculator;
|
||||
private ClicksPerSecondCalculator? calculator;
|
||||
|
||||
protected override double RollingDuration => 350;
|
||||
|
||||
public bool UsesFixedAnchor { get; set; }
|
||||
|
||||
public KeysPerSecondCounter()
|
||||
public ClicksPerSecondCounter()
|
||||
{
|
||||
Current.Value = 0;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours, KeysPerSecondCalculator calculator)
|
||||
private void load(OsuColour colours, ClicksPerSecondCalculator calculator)
|
||||
{
|
||||
this.calculator = calculator;
|
||||
Colour = colours.BlueLighter;
|
@ -22,7 +22,7 @@ using osu.Game.Rulesets.Mods;
|
||||
using osu.Game.Rulesets.Scoring;
|
||||
using osu.Game.Rulesets.UI;
|
||||
using osu.Game.Screens.Play.HUD;
|
||||
using osu.Game.Screens.Play.HUD.KeysPerSecond;
|
||||
using osu.Game.Screens.Play.HUD.ClicksPerSecond;
|
||||
using osu.Game.Skinning;
|
||||
using osuTK;
|
||||
|
||||
@ -51,7 +51,7 @@ namespace osu.Game.Screens.Play
|
||||
public readonly PlayerSettingsOverlay PlayerSettingsOverlay;
|
||||
|
||||
[Cached]
|
||||
private readonly KeysPerSecondCalculator keysPerSecondCalculator;
|
||||
private readonly ClicksPerSecondCalculator clicksPerSecondCalculator;
|
||||
|
||||
public Bindable<bool> ShowHealthBar = new Bindable<bool>(true);
|
||||
|
||||
@ -127,7 +127,7 @@ namespace osu.Game.Screens.Play
|
||||
HoldToQuit = CreateHoldForMenuButton(),
|
||||
}
|
||||
},
|
||||
keysPerSecondCalculator = new KeysPerSecondCalculator()
|
||||
clicksPerSecondCalculator = new ClicksPerSecondCalculator()
|
||||
};
|
||||
}
|
||||
|
||||
@ -265,7 +265,7 @@ namespace osu.Game.Screens.Play
|
||||
protected virtual void BindDrawableRuleset(DrawableRuleset drawableRuleset)
|
||||
{
|
||||
(drawableRuleset as ICanAttachKeyCounter)?.Attach(KeyCounter);
|
||||
(drawableRuleset as ICanAttachKeyCounter)?.Attach(keysPerSecondCalculator);
|
||||
(drawableRuleset as ICanAttachKeyCounter)?.Attach(clicksPerSecondCalculator);
|
||||
|
||||
replayLoaded.BindTo(drawableRuleset.HasReplayLoaded);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user