1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-11 11:37:28 +08:00

Move callback to LoadComplete()

Is the more correct place for `BindValueChanged()` callbacks.
This commit is contained in:
Bartłomiej Dach 2023-05-03 09:26:54 +02:00
parent a3efae3690
commit 5f781bd6de
No known key found for this signature in database

View File

@ -94,14 +94,19 @@ namespace osu.Game.Graphics.UserInterface
sampleChecked = audio.Samples.Get(@"UI/check-on");
sampleUnchecked = audio.Samples.Get(@"UI/check-off");
}
Current.ValueChanged += selected =>
protected override void LoadComplete()
{
base.LoadComplete();
Current.BindValueChanged(selected =>
{
icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
updateFade();
};
});
}
protected override bool OnHover(HoverEvent e)