mirror of
https://github.com/ppy/osu.git
synced 2025-02-19 18:22:59 +08:00
Move KeysPerSecondCalculator
instantiation from HUDOverlay
to Player
This prevents messing with *future* Skin (de)serialization
This commit is contained in:
parent
3c6461b9e4
commit
787dee249d
@ -50,8 +50,7 @@ namespace osu.Game.Screens.Play
|
|||||||
public readonly HoldForMenuButton HoldToQuit;
|
public readonly HoldForMenuButton HoldToQuit;
|
||||||
public readonly PlayerSettingsOverlay PlayerSettingsOverlay;
|
public readonly PlayerSettingsOverlay PlayerSettingsOverlay;
|
||||||
|
|
||||||
[Cached]
|
private KeysPerSecondCalculator keysPerSecondCalculator;
|
||||||
private readonly KeysPerSecondCalculator keysPerSecondCalculator;
|
|
||||||
|
|
||||||
public Bindable<bool> ShowHealthBar = new Bindable<bool>(true);
|
public Bindable<bool> ShowHealthBar = new Bindable<bool>(true);
|
||||||
|
|
||||||
@ -131,8 +130,10 @@ namespace osu.Game.Screens.Play
|
|||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader(true)]
|
[BackgroundDependencyLoader(true)]
|
||||||
private void load(OsuConfigManager config, INotificationOverlay notificationOverlay)
|
private void load(OsuConfigManager config, INotificationOverlay notificationOverlay, KeysPerSecondCalculator calculator)
|
||||||
{
|
{
|
||||||
|
keysPerSecondCalculator = calculator;
|
||||||
|
|
||||||
if (drawableRuleset != null)
|
if (drawableRuleset != null)
|
||||||
{
|
{
|
||||||
BindDrawableRuleset(drawableRuleset);
|
BindDrawableRuleset(drawableRuleset);
|
||||||
|
@ -34,6 +34,7 @@ using osu.Game.Rulesets.Scoring;
|
|||||||
using osu.Game.Rulesets.UI;
|
using osu.Game.Rulesets.UI;
|
||||||
using osu.Game.Scoring;
|
using osu.Game.Scoring;
|
||||||
using osu.Game.Scoring.Legacy;
|
using osu.Game.Scoring.Legacy;
|
||||||
|
using osu.Game.Screens.Play.HUD.KeysPerSecond;
|
||||||
using osu.Game.Screens.Ranking;
|
using osu.Game.Screens.Ranking;
|
||||||
using osu.Game.Skinning;
|
using osu.Game.Skinning;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
@ -122,6 +123,8 @@ namespace osu.Game.Screens.Play
|
|||||||
private SkipOverlay skipIntroOverlay;
|
private SkipOverlay skipIntroOverlay;
|
||||||
private SkipOverlay skipOutroOverlay;
|
private SkipOverlay skipOutroOverlay;
|
||||||
|
|
||||||
|
protected KeysPerSecondCalculator KeysPerSecondCalculator { get; private set; }
|
||||||
|
|
||||||
protected ScoreProcessor ScoreProcessor { get; private set; }
|
protected ScoreProcessor ScoreProcessor { get; private set; }
|
||||||
|
|
||||||
protected HealthProcessor HealthProcessor { get; private set; }
|
protected HealthProcessor HealthProcessor { get; private set; }
|
||||||
@ -226,6 +229,9 @@ namespace osu.Game.Screens.Play
|
|||||||
|
|
||||||
dependencies.CacheAs(ScoreProcessor);
|
dependencies.CacheAs(ScoreProcessor);
|
||||||
|
|
||||||
|
KeysPerSecondCalculator = new KeysPerSecondCalculator();
|
||||||
|
dependencies.CacheAs(KeysPerSecondCalculator);
|
||||||
|
|
||||||
HealthProcessor = ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
HealthProcessor = ruleset.CreateHealthProcessor(playableBeatmap.HitObjects[0].StartTime);
|
||||||
HealthProcessor.ApplyBeatmap(playableBeatmap);
|
HealthProcessor.ApplyBeatmap(playableBeatmap);
|
||||||
|
|
||||||
@ -442,6 +448,7 @@ namespace osu.Game.Screens.Play
|
|||||||
OnRetry = Restart,
|
OnRetry = Restart,
|
||||||
OnQuit = () => PerformExit(true),
|
OnQuit = () => PerformExit(true),
|
||||||
},
|
},
|
||||||
|
KeysPerSecondCalculator
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user