1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-23 08:27:23 +08:00

Make KeysPerSecondCalculator dependency in HUDOverlay nullable

This commit is contained in:
Ryuki 2022-08-11 11:58:30 +02:00
parent d29cba80e9
commit 9b252b1d81
No known key found for this signature in database
GPG Key ID: A353889EAEACBF49
2 changed files with 5 additions and 4 deletions

View File

@ -191,6 +191,8 @@ namespace osu.Game.Rulesets.UI
public void Attach(KeysPerSecondCalculator calculator)
{
if (calculator == null) return;
var listener = new ActionListener();
KeyBindingContainer.Add(listener);

View File

@ -50,7 +50,8 @@ namespace osu.Game.Screens.Play
public readonly HoldForMenuButton HoldToQuit;
public readonly PlayerSettingsOverlay PlayerSettingsOverlay;
private KeysPerSecondCalculator keysPerSecondCalculator;
[Resolved(canBeNull: true)]
private KeysPerSecondCalculator keysPerSecondCalculator { get; set; }
public Bindable<bool> ShowHealthBar = new Bindable<bool>(true);
@ -130,10 +131,8 @@ namespace osu.Game.Screens.Play
}
[BackgroundDependencyLoader(true)]
private void load(OsuConfigManager config, INotificationOverlay notificationOverlay, KeysPerSecondCalculator calculator)
private void load(OsuConfigManager config, INotificationOverlay notificationOverlay)
{
keysPerSecondCalculator = calculator;
if (drawableRuleset != null)
{
BindDrawableRuleset(drawableRuleset);