mirror of
https://github.com/ppy/osu
synced 2024-12-12 01:48:49 +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]
|
[Resolved]
|
||||||
private OsuColour colours { get; set; }
|
private OsuColour colours { get; set; }
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
|
||||||
private ManiaRulesetConfigManager config { get; set; }
|
|
||||||
|
|
||||||
private readonly Bindable<bool> configColourCodedNotes = new Bindable<bool>();
|
private readonly Bindable<bool> configColourCodedNotes = new Bindable<bool>();
|
||||||
|
|
||||||
[Resolved(canBeNull: true)]
|
|
||||||
private SnapFinder snapFinder { get; set; }
|
|
||||||
|
|
||||||
protected virtual ManiaSkinComponents Component => ManiaSkinComponents.Note;
|
protected virtual ManiaSkinComponents Component => ManiaSkinComponents.Note;
|
||||||
|
|
||||||
private readonly Drawable headPiece;
|
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)
|
if (snapFinder != null)
|
||||||
{
|
{
|
||||||
config?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes);
|
rulesetConfig?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes);
|
||||||
|
|
||||||
HitObject.StartTimeBindable.BindValueChanged(_ => snap.Value = snapFinder.FindSnap(HitObject), true);
|
HitObject.StartTimeBindable.BindValueChanged(_ => snap.Value = snapFinder.FindSnap(HitObject), true);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user