From cafa605b90e6d34c30bdc687bfd9de0733efbe7a Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 8 Feb 2018 14:43:07 +0900 Subject: [PATCH] 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 --- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 5e7dda8713..f06313c261 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -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)