mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Fix potentially incorrect thread access in OsuTabControlCheckbox
https://github.com/ppy/osu/actions/runs/4868337922/jobs/8681736829.
This commit is contained in:
@ -49,11 +49,10 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
private const float transition_length = 500;
|
private const float transition_length = 500;
|
||||||
private Sample sampleChecked;
|
private Sample sampleChecked;
|
||||||
private Sample sampleUnchecked;
|
private Sample sampleUnchecked;
|
||||||
|
private readonly SpriteIcon icon;
|
||||||
|
|
||||||
public OsuTabControlCheckbox()
|
public OsuTabControlCheckbox()
|
||||||
{
|
{
|
||||||
SpriteIcon icon;
|
|
||||||
|
|
||||||
AutoSizeAxes = Axes.Both;
|
AutoSizeAxes = Axes.Both;
|
||||||
|
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
@ -85,14 +84,6 @@ namespace osu.Game.Graphics.UserInterface
|
|||||||
Anchor = Anchor.BottomLeft,
|
Anchor = Anchor.BottomLeft,
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Current.ValueChanged += selected =>
|
|
||||||
{
|
|
||||||
icon.Icon = selected.NewValue ? FontAwesome.Regular.CheckCircle : FontAwesome.Regular.Circle;
|
|
||||||
text.Font = text.Font.With(weight: selected.NewValue ? FontWeight.Bold : FontWeight.Medium);
|
|
||||||
|
|
||||||
updateFade();
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -103,6 +94,14 @@ 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 =>
|
||||||
|
{
|
||||||
|
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)
|
protected override bool OnHover(HoverEvent e)
|
||||||
|
Reference in New Issue
Block a user