Initialize some bindables for prevent get the null instance.

This commit is contained in:
為什麼
2022-07-10 23:16:51 +08:00
committed by andy840119
parent 1f9f2b413e
commit ce1bb206c8
4 changed files with 10 additions and 10 deletions

View File

@ -33,7 +33,7 @@ namespace osu.Game.Rulesets.Mods
private readonly BindableNumber<double> mainVolumeAdjust = new BindableDouble(0.5);
private readonly BindableNumber<double> metronomeVolumeAdjust = new BindableDouble(0.5);
private BindableNumber<int> currentCombo;
private readonly BindableNumber<int> currentCombo = new BindableInt();
[SettingSource("Enable metronome", "Add a metronome beat to help you keep track of the rhythm.")]
public BindableBool EnableMetronome { get; } = new BindableBool
@ -92,7 +92,7 @@ namespace osu.Game.Rulesets.Mods
public void ApplyToScoreProcessor(ScoreProcessor scoreProcessor)
{
currentCombo = scoreProcessor.Combo.GetBoundCopy();
currentCombo.BindTo(scoreProcessor.Combo);
currentCombo.BindValueChanged(combo =>
{
double dimFactor = MuteComboCount.Value == 0 ? 1 : (double)combo.NewValue / MuteComboCount.Value;