Use null-permitting BDL to reduce number of fields

This commit is contained in:
Bartłomiej Dach 2021-04-25 17:40:23 +02:00
parent 211bff6a8f
commit f9e228d6bf

View File

@ -26,14 +26,8 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
[Resolved]
private OsuColour colours { get; set; }
[Resolved(canBeNull: true)]
private ManiaRulesetConfigManager config { get; set; }
private readonly Bindable<bool> configColourCodedNotes = new Bindable<bool>();
[Resolved(canBeNull: true)]
private SnapFinder snapFinder { get; set; }
protected virtual ManiaSkinComponents Component => ManiaSkinComponents.Note;
private readonly Drawable headPiece;
@ -53,13 +47,12 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
});
}
protected override void LoadComplete()
[BackgroundDependencyLoader(true)]
private void load(ManiaRulesetConfigManager rulesetConfig, SnapFinder snapFinder)
{
base.LoadComplete();
if (snapFinder != null)
{
config?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes);
rulesetConfig?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes);
HitObject.StartTimeBindable.BindValueChanged(_ => snap.Value = snapFinder.FindSnap(HitObject), true);
@ -115,4 +108,4 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
: (ColourInfo)Colour4.White;
}
}
}
}