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:
parent
a3efae3690
commit
5f781bd6de
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user