Revert 787dee24 and initialize calculator in HUDOverlay

This commit is contained in:
Ryuki 2022-08-14 18:53:00 +02:00
parent e08f71797e
commit d5f10cbb9d
No known key found for this signature in database
GPG Key ID: A353889EAEACBF49
2 changed files with 3 additions and 9 deletions

View File

@ -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<bool> ShowHealthBar = new Bindable<bool>(true);
@ -127,6 +127,7 @@ namespace osu.Game.Screens.Play
HoldToQuit = CreateHoldForMenuButton(),
}
},
keysPerSecondCalculator = new KeysPerSecondCalculator()
};
}

View File

@ -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
},
};