1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-14 02:22:56 +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"); sampleChecked = audio.Samples.Get(@"UI/check-on");
sampleUnchecked = audio.Samples.Get(@"UI/check-off"); 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; icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium); text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
updateFade(); updateFade();
}; });
} }
protected override bool OnHover(HoverEvent e) protected override bool OnHover(HoverEvent e)