mirror of
https://github.com/ppy/osu
synced 2024-12-11 17:42:28 +00:00
Use null-permitting BDL to reduce number of fields
This commit is contained in:
parent
211bff6a8f
commit
f9e228d6bf
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user