Move KeysPerSecondCalculator instantiation from HUDOverlay to Player

This prevents messing with *future* Skin (de)serialization
This commit is contained in:
Ryuki
2022-08-11 10:37:06 +02:00
parent 3c6461b9e4
commit 787dee249d
2 changed files with 11 additions and 3 deletions

View File

@ -34,6 +34,7 @@ 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;
@ -122,6 +123,8 @@ 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; }
@ -226,6 +229,9 @@ namespace osu.Game.Screens.Play
dependencies.CacheAs(ScoreProcessor);
KeysPerSecondCalculator = new KeysPerSecondCalculator();
dependencies.CacheAs(KeysPerSecondCalculator);
HealthProcessor = ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
HealthProcessor.ApplyBeatmap(playableBeatmap);
@ -442,6 +448,7 @@ namespace osu.Game.Screens.Play
OnRetry = Restart,
OnQuit = () => PerformExit(true),
},
KeysPerSecondCalculator
},
};