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