Fix visual settings checkboxes playing sounds in bindable binding

Move sound binding to much later in the process to avoid programmatic checkbox changes triggering interaction sounds
This commit is contained in:
Dean Herbert 2018-02-08 14:43:07 +09:00
parent 998acc5150
commit cafa605b90
1 changed files with 10 additions and 5 deletions

View File

@ -76,6 +76,16 @@ public OsuCheckbox()
Nub.Current.BindTo(Current);
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
protected override void LoadComplete()
{
base.LoadComplete();
Current.ValueChanged += newValue =>
{
if (newValue)
@ -83,11 +93,6 @@ public OsuCheckbox()
else
sampleUnchecked?.Play();
};
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
protected override bool OnHover(InputState state)