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

View File

@ -76,6 +76,16 @@ namespace osu.Game.Graphics.UserInterface
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 @@ namespace osu.Game.Graphics.UserInterface
else
sampleUnchecked?.Play();
};
Current.DisabledChanged += disabled =>
{
Alpha = disabled ? 0.3f : 1;
};
}
protected override bool OnHover(InputState state)