From 3c6461b9e4383174278cf3b4ab7493a6c076473d Mon Sep 17 00:00:00 2001 From: Ryuki Date: Thu, 11 Aug 2022 09:36:35 +0200 Subject: [PATCH] Remove KPS acronym usage --- .../Visual/Gameplay/TestSceneKeysPerSecond.cs | 2 +- osu.Game/Rulesets/UI/DrawableRuleset.cs | 6 +++--- osu.Game/Rulesets/UI/RulesetInputManager.cs | 16 ++++++---------- .../KeysPerSecondCalculator.cs | 2 +- .../KeysPerSecondCounter.cs | 4 ++-- osu.Game/Screens/Play/HUDOverlay.cs | 5 ++--- 6 files changed, 15 insertions(+), 20 deletions(-) rename osu.Game/Screens/Play/HUD/{KPSCounter => KeysPerSecond}/KeysPerSecondCalculator.cs (98%) rename osu.Game/Screens/Play/HUD/{KPSCounter => KeysPerSecond}/KeysPerSecondCounter.cs (98%) diff --git a/osu.Game.Tests/Visual/Gameplay/TestSceneKeysPerSecond.cs b/osu.Game.Tests/Visual/Gameplay/TestSceneKeysPerSecond.cs index edfba7f154..5c1ca18dbc 100644 --- a/osu.Game.Tests/Visual/Gameplay/TestSceneKeysPerSecond.cs +++ b/osu.Game.Tests/Visual/Gameplay/TestSceneKeysPerSecond.cs @@ -19,7 +19,7 @@ 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.KPSCounter; +using osu.Game.Screens.Play.HUD.KeysPerSecond; using osuTK; namespace osu.Game.Tests.Visual.Gameplay diff --git a/osu.Game/Rulesets/UI/DrawableRuleset.cs b/osu.Game/Rulesets/UI/DrawableRuleset.cs index b28e3355a4..443e4392cf 100644 --- a/osu.Game/Rulesets/UI/DrawableRuleset.cs +++ b/osu.Game/Rulesets/UI/DrawableRuleset.cs @@ -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.KPSCounter; +using osu.Game.Screens.Play.HUD.KeysPerSecond; using osuTK; namespace osu.Game.Rulesets.UI @@ -39,7 +39,7 @@ namespace osu.Game.Rulesets.UI /// Displays an interactive ruleset gameplay instance. /// /// The type of HitObject contained by this DrawableRuleset. - public abstract class DrawableRuleset : DrawableRuleset, IProvideCursor, ICanAttachKeyCounter, ICanAttachKpsCalculator + public abstract class DrawableRuleset : DrawableRuleset, IProvideCursor, ICanAttachKeyCounter where TObject : HitObject { public override event Action NewResult; @@ -341,7 +341,7 @@ namespace osu.Game.Rulesets.UI public void Attach(KeyCounterDisplay keyCounter) => (KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(keyCounter); - public void Attach(KeysPerSecondCalculator kps) => (KeyBindingInputManager as ICanAttachKpsCalculator)?.Attach(kps); + public void Attach(KeysPerSecondCalculator calculator) => (KeyBindingInputManager as ICanAttachKeyCounter)?.Attach(calculator); /// /// Creates a key conversion input manager. An exception will be thrown if a valid is not returned. diff --git a/osu.Game/Rulesets/UI/RulesetInputManager.cs b/osu.Game/Rulesets/UI/RulesetInputManager.cs index 23e64153eb..2e9986ada6 100644 --- a/osu.Game/Rulesets/UI/RulesetInputManager.cs +++ b/osu.Game/Rulesets/UI/RulesetInputManager.cs @@ -20,12 +20,12 @@ 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.KPSCounter; +using osu.Game.Screens.Play.HUD.KeysPerSecond; using static osu.Game.Input.Handlers.ReplayInputHandler; namespace osu.Game.Rulesets.UI { - public abstract class RulesetInputManager : PassThroughInputManager, ICanAttachKeyCounter, IHasReplayHandler, IHasRecordingHandler, ICanAttachKpsCalculator + public abstract class RulesetInputManager : PassThroughInputManager, ICanAttachKeyCounter, IHasReplayHandler, IHasRecordingHandler where T : struct { public readonly KeyBindingContainer KeyBindingContainer; @@ -187,15 +187,15 @@ namespace osu.Game.Rulesets.UI #endregion - #region KPS Counter Attachment + #region Keys per second Counter Attachment - public void Attach(KeysPerSecondCalculator kps) + public void Attach(KeysPerSecondCalculator calculator) { var listener = new ActionListener(); KeyBindingContainer.Add(listener); - kps.Listener = listener; + calculator.Listener = listener; } public class ActionListener : KeysPerSecondCalculator.InputListener, IKeyBindingHandler @@ -257,11 +257,7 @@ namespace osu.Game.Rulesets.UI public interface ICanAttachKeyCounter { void Attach(KeyCounterDisplay keyCounter); - } - - public interface ICanAttachKpsCalculator - { - void Attach(KeysPerSecondCalculator keysPerSecondCalculator); + void Attach(KeysPerSecondCalculator calculator); } public class RulesetInputManagerInputState : InputState diff --git a/osu.Game/Screens/Play/HUD/KPSCounter/KeysPerSecondCalculator.cs b/osu.Game/Screens/Play/HUD/KeysPerSecond/KeysPerSecondCalculator.cs similarity index 98% rename from osu.Game/Screens/Play/HUD/KPSCounter/KeysPerSecondCalculator.cs rename to osu.Game/Screens/Play/HUD/KeysPerSecond/KeysPerSecondCalculator.cs index dddef9abaf..ecc9c6ef86 100644 --- a/osu.Game/Screens/Play/HUD/KPSCounter/KeysPerSecondCalculator.cs +++ b/osu.Game/Screens/Play/HUD/KeysPerSecond/KeysPerSecondCalculator.cs @@ -9,7 +9,7 @@ using osu.Framework.Graphics; using osu.Framework.Timing; using osu.Game.Rulesets.UI; -namespace osu.Game.Screens.Play.HUD.KPSCounter +namespace osu.Game.Screens.Play.HUD.KeysPerSecond { public class KeysPerSecondCalculator : Component { diff --git a/osu.Game/Screens/Play/HUD/KPSCounter/KeysPerSecondCounter.cs b/osu.Game/Screens/Play/HUD/KeysPerSecond/KeysPerSecondCounter.cs similarity index 98% rename from osu.Game/Screens/Play/HUD/KPSCounter/KeysPerSecondCounter.cs rename to osu.Game/Screens/Play/HUD/KeysPerSecond/KeysPerSecondCounter.cs index 47ebede623..6589dbb719 100644 --- a/osu.Game/Screens/Play/HUD/KPSCounter/KeysPerSecondCounter.cs +++ b/osu.Game/Screens/Play/HUD/KeysPerSecond/KeysPerSecondCounter.cs @@ -10,11 +10,11 @@ using osu.Framework.Localisation; using osu.Game.Graphics; using osu.Game.Graphics.Sprites; using osu.Game.Graphics.UserInterface; -// using osu.Game.Rulesets.UI; using osu.Game.Skinning; using osuTK; +// using osu.Game.Rulesets.UI; -namespace osu.Game.Screens.Play.HUD.KPSCounter +namespace osu.Game.Screens.Play.HUD.KeysPerSecond { public class KeysPerSecondCounter : RollingCounter, ISkinnableDrawable { diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 1c28e04950..20a1a27f3d 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -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.KPSCounter; +using osu.Game.Screens.Play.HUD.KeysPerSecond; using osu.Game.Skinning; using osuTK; @@ -127,7 +127,6 @@ namespace osu.Game.Screens.Play HoldToQuit = CreateHoldForMenuButton(), } }, - keysPerSecondCalculator = new KeysPerSecondCalculator() }; } @@ -265,7 +264,7 @@ namespace osu.Game.Screens.Play protected virtual void BindDrawableRuleset(DrawableRuleset drawableRuleset) { (drawableRuleset as ICanAttachKeyCounter)?.Attach(KeyCounter); - (drawableRuleset as ICanAttachKpsCalculator)?.Attach(keysPerSecondCalculator); + (drawableRuleset as ICanAttachKeyCounter)?.Attach(keysPerSecondCalculator); replayLoaded.BindTo(drawableRuleset.HasReplayLoaded); }