From d5f10cbb9d1396ab10c32981c436729fb4c2c639 Mon Sep 17 00:00:00 2001 From: Ryuki Date: Sun, 14 Aug 2022 18:53:00 +0200 Subject: [PATCH] Revert 787dee24 and initialize calculator in `HUDOverlay` --- osu.Game/Screens/Play/HUDOverlay.cs | 5 +++-- osu.Game/Screens/Play/Player.cs | 7 ------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/osu.Game/Screens/Play/HUDOverlay.cs b/osu.Game/Screens/Play/HUDOverlay.cs index 458e19826b..20f7f7d6c2 100644 --- a/osu.Game/Screens/Play/HUDOverlay.cs +++ b/osu.Game/Screens/Play/HUDOverlay.cs @@ -50,8 +50,8 @@ namespace osu.Game.Screens.Play public readonly HoldForMenuButton HoldToQuit; public readonly PlayerSettingsOverlay PlayerSettingsOverlay; - [Resolved(canBeNull: true)] - private KeysPerSecondCalculator keysPerSecondCalculator { get; set; } + [Cached] + private readonly KeysPerSecondCalculator keysPerSecondCalculator; public Bindable ShowHealthBar = new Bindable(true); @@ -127,6 +127,7 @@ namespace osu.Game.Screens.Play HoldToQuit = CreateHoldForMenuButton(), } }, + keysPerSecondCalculator = new KeysPerSecondCalculator() }; } diff --git a/osu.Game/Screens/Play/Player.cs b/osu.Game/Screens/Play/Player.cs index ba7e01a803..e3844088e2 100644 --- a/osu.Game/Screens/Play/Player.cs +++ b/osu.Game/Screens/Play/Player.cs @@ -34,7 +34,6 @@ using osu.Game.Rulesets.Scoring; using osu.Game.Rulesets.UI; using osu.Game.Scoring; using osu.Game.Scoring.Legacy; -using osu.Game.Screens.Play.HUD.KeysPerSecond; using osu.Game.Screens.Ranking; using osu.Game.Skinning; using osu.Game.Users; @@ -123,8 +122,6 @@ namespace osu.Game.Screens.Play private SkipOverlay skipIntroOverlay; private SkipOverlay skipOutroOverlay; - protected KeysPerSecondCalculator KeysPerSecondCalculator { get; private set; } - protected ScoreProcessor ScoreProcessor { get; private set; } protected HealthProcessor HealthProcessor { get; private set; } @@ -229,9 +226,6 @@ namespace osu.Game.Screens.Play dependencies.CacheAs(ScoreProcessor); - KeysPerSecondCalculator = new KeysPerSecondCalculator(); - dependencies.CacheAs(KeysPerSecondCalculator); - HealthProcessor = ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime); HealthProcessor.ApplyBeatmap(playableBeatmap); @@ -448,7 +442,6 @@ namespace osu.Game.Screens.Play OnRetry = Restart, OnQuit = () => PerformExit(true), }, - KeysPerSecondCalculator }, };