1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-14 13:22:55 +08:00

Move BindValueChanged hooks to LoadComplete()

This commit is contained in:
Justus Franklin Tumacder 2021-04-26 19:00:40 +08:00
parent 8bb1fcd39b
commit 58ebec4803

View File

@ -26,6 +26,9 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
[Resolved]
private OsuColour colours { get; set; }
[Resolved]
private BeatDivisorFinder beatDivisorFinder { get; set; }
private readonly Bindable<bool> configColourCodedNotes = new Bindable<bool>();
protected virtual ManiaSkinComponents Component => ManiaSkinComponents.Note;
@ -48,17 +51,20 @@ namespace osu.Game.Rulesets.Mania.Objects.Drawables
}
[BackgroundDependencyLoader(true)]
private void load(ManiaRulesetConfigManager rulesetConfig, BeatDivisorFinder beatDivisorFinder)
private void load(ManiaRulesetConfigManager rulesetConfig)
{
rulesetConfig?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes);
}
protected override void LoadComplete()
{
if (beatDivisorFinder != null)
{
rulesetConfig?.BindWith(ManiaRulesetSetting.ColourCodedNotes, configColourCodedNotes);
HitObject.StartTimeBindable.BindValueChanged(_ => snap.Value = beatDivisorFinder.FindDivisor(HitObject), true);
snap.BindValueChanged(_ => updateSnapColour(), true);
configColourCodedNotes.BindValueChanged(_ => updateSnapColour());
}
snap.BindValueChanged(_ => updateSnapColour());
configColourCodedNotes.BindValueChanged(_ => updateSnapColour(), true);
}
protected override void OnDirectionChanged(ValueChangedEvent<ScrollingDirection> e)