Merge pull request #2037 from peppy/fix-checkbox-sounds

Fix visual settings checkboxes playing sounds in bindable binding
This commit is contained in:
Dean Herbert 2018-02-08 16:05:18 +09:00 committed by GitHub
commit 553c9bb2fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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)