From b7cfdff8d13be4cde6640b638dd60b0579df0baa Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 10 Apr 2017 15:30:17 +0900 Subject: [PATCH 1/5] Update SliderBar to use IHasCurrentValue. --- osu-framework | 2 +- osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs | 2 +- osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs | 2 +- osu.Game/Overlays/Options/OptionSlider.cs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/osu-framework b/osu-framework index bbfd0fc7a8..561b24bed4 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit bbfd0fc7a8f5293a0f853f51040b40808abbb459 +Subproject commit 561b24bed48d3670b1d33acfc7ba5e11dcd3ac0c diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index 99da7d1c73..b14607f235 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -112,7 +112,7 @@ namespace osu.Desktop.VisualTests.Tests Width = 150, Height = 10, SelectionColor = Color4.Orange, - Value = playbackSpeed + Current = playbackSpeed } } }); diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs index 7e7782662b..d41da04b3e 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs @@ -57,7 +57,7 @@ namespace osu.Desktop.VisualTests.Tests Width = 150, Height = 10, SelectionColor = Color4.Orange, - Value = bindable + Current = bindable } } }); diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 8fa9bf063d..1cd9fdc60c 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -27,12 +27,12 @@ namespace osu.Game.Overlays.Options } } - public BindableNumber Bindable + public Bindable Bindable { - get { return slider.Value; } + get { return slider.Current; } set { - slider.Value = value; + slider.Current = value; if (value?.Disabled ?? true) Alpha = 0.3f; } From f12b5a8954306c7cb94a50d0248cb1d8ab523ee7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 10 Apr 2017 16:22:36 +0900 Subject: [PATCH 2/5] Unify disable logic. --- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 7 ++----- osu.Game/Overlays/Options/OptionDropdown.cs | 2 +- osu.Game/Overlays/Options/OptionSlider.cs | 6 ++++-- osu.Game/Overlays/Options/OptionTextBox.cs | 4 +--- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 5d4760fec6..6dfbc931cf 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -24,11 +24,8 @@ namespace osu.Game.Graphics.UserInterface set { bindable = value; - - if (bindable != null) - Current = bindable; - - if (bindable?.Disabled ?? true) + Current = bindable; + if (value?.Disabled ?? true) Alpha = 0.3f; } } diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Options/OptionDropdown.cs index decf5896c2..332c95328b 100644 --- a/osu.Game/Overlays/Options/OptionDropdown.cs +++ b/osu.Game/Overlays/Options/OptionDropdown.cs @@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Options { bindable = value; dropdown.Current = bindable; - if (bindable.Disabled) + if (value?.Disabled ?? true) Alpha = 0.3f; } } diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 1cd9fdc60c..0b0a9b8b50 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -27,12 +27,14 @@ namespace osu.Game.Overlays.Options } } + private Bindable bindable; + public Bindable Bindable { - get { return slider.Current; } set { - slider.Current = value; + bindable = value; + slider.Current = bindable; if (value?.Disabled ?? true) Alpha = 0.3f; } diff --git a/osu.Game/Overlays/Options/OptionTextBox.cs b/osu.Game/Overlays/Options/OptionTextBox.cs index 346c9f88f5..c2c8e91016 100644 --- a/osu.Game/Overlays/Options/OptionTextBox.cs +++ b/osu.Game/Overlays/Options/OptionTextBox.cs @@ -15,10 +15,8 @@ namespace osu.Game.Overlays.Options set { bindable = value; - Current = bindable; - - if (bindable?.Disabled ?? true) + if (value?.Disabled ?? true) Alpha = 0.3f; } } From ba03a989925285ab0f979238de7711657fa5d04c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 10 Apr 2017 16:39:10 +0900 Subject: [PATCH 3/5] Add missing config set. --- osu.Game/Configuration/OsuConfigManager.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/osu.Game/Configuration/OsuConfigManager.cs b/osu.Game/Configuration/OsuConfigManager.cs index 7d7c61b69a..e2f33479c0 100644 --- a/osu.Game/Configuration/OsuConfigManager.cs +++ b/osu.Game/Configuration/OsuConfigManager.cs @@ -46,6 +46,7 @@ namespace osu.Game.Configuration Set(OsuConfig.AutomaticDownload, true).Disabled = true; Set(OsuConfig.AutomaticDownloadNoVideo, false).Disabled = true; Set(OsuConfig.BlockNonFriendPM, false).Disabled = true; + Set(OsuConfig.Bloom, false).Disabled = true; Set(OsuConfig.BloomSoftening, false).Disabled = true; Set(OsuConfig.BossKeyFirstActivation, true).Disabled = true; Set(OsuConfig.ChatAudibleHighlight, true).Disabled = true; From 5af4259ab42f5576ff3dfd5f3aee0face56a3464 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 10 Apr 2017 17:10:15 +0900 Subject: [PATCH 4/5] Add back explicit binds. --- osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs | 6 ++++-- osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs | 7 +++++-- osu.Game/Graphics/UserInterface/Nub.cs | 8 +------- osu.Game/Graphics/UserInterface/OsuCheckbox.cs | 5 +++-- osu.Game/Overlays/Options/OptionDropdown.cs | 2 +- osu.Game/Overlays/Options/OptionSlider.cs | 2 +- osu.Game/Overlays/Options/OptionTextBox.cs | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs index b14607f235..3d9f3aad79 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseHitObjects.cs @@ -99,6 +99,7 @@ namespace osu.Desktop.VisualTests.Tests AddToggleStep(@"auto", state => { auto = state; load(mode); }); + BasicSliderBar sliderBar; Add(new Container { Anchor = Anchor.TopRight, @@ -107,16 +108,17 @@ namespace osu.Desktop.VisualTests.Tests Children = new Drawable[] { new SpriteText { Text = "Playback Speed" }, - new BasicSliderBar + sliderBar = new BasicSliderBar { Width = 150, Height = 10, SelectionColor = Color4.Orange, - Current = playbackSpeed } } }); + sliderBar.Current.BindTo(playbackSpeed); + framedClock.ProcessFrame(); var clockAdjustContainer = new Container diff --git a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs index d41da04b3e..b1b9ddbcda 100644 --- a/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs +++ b/osu.Desktop.VisualTests/Tests/TestCaseKeyCounter.cs @@ -44,6 +44,8 @@ namespace osu.Desktop.VisualTests.Tests kc.Add(new KeyCounterKeyboard(key)); }); + TestSliderBar sliderBar; + Add(new Container { Anchor = Anchor.TopRight, @@ -52,16 +54,17 @@ namespace osu.Desktop.VisualTests.Tests Children = new Drawable[] { new SpriteText { Text = "FadeTime" }, - new TestSliderBar + sliderBar =new TestSliderBar { Width = 150, Height = 10, SelectionColor = Color4.Orange, - Current = bindable } } }); + sliderBar.Current.BindTo(bindable); + Add(kc); } private class TestSliderBar : SliderBar where T : struct diff --git a/osu.Game/Graphics/UserInterface/Nub.cs b/osu.Game/Graphics/UserInterface/Nub.cs index a5a4fab3e1..82ede8f079 100644 --- a/osu.Game/Graphics/UserInterface/Nub.cs +++ b/osu.Game/Graphics/UserInterface/Nub.cs @@ -92,12 +92,6 @@ namespace osu.Game.Graphics.UserInterface } } - private readonly Bindable current = new Bindable(); - - public Bindable Current - { - get { return current; } - set { current.BindTo(value); } - } + public Bindable Current { get; } = new Bindable(); } } diff --git a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs index 6dfbc931cf..d339388aa5 100644 --- a/osu.Game/Graphics/UserInterface/OsuCheckbox.cs +++ b/osu.Game/Graphics/UserInterface/OsuCheckbox.cs @@ -24,7 +24,7 @@ namespace osu.Game.Graphics.UserInterface set { bindable = value; - Current = bindable; + Current.BindTo(bindable); if (value?.Disabled ?? true) Alpha = 0.3f; } @@ -69,13 +69,14 @@ namespace osu.Game.Graphics.UserInterface labelSpriteText = new OsuSpriteText(), nub = new Nub { - Current = Current, Anchor = Anchor.CentreRight, Origin = Anchor.CentreRight, Margin = new MarginPadding { Right = 5 }, } }; + nub.Current.BindTo(Current); + Current.ValueChanged += newValue => { if (newValue) diff --git a/osu.Game/Overlays/Options/OptionDropdown.cs b/osu.Game/Overlays/Options/OptionDropdown.cs index 332c95328b..ee12ba9b05 100644 --- a/osu.Game/Overlays/Options/OptionDropdown.cs +++ b/osu.Game/Overlays/Options/OptionDropdown.cs @@ -33,7 +33,7 @@ namespace osu.Game.Overlays.Options set { bindable = value; - dropdown.Current = bindable; + dropdown.Current.BindTo(bindable); if (value?.Disabled ?? true) Alpha = 0.3f; } diff --git a/osu.Game/Overlays/Options/OptionSlider.cs b/osu.Game/Overlays/Options/OptionSlider.cs index 0b0a9b8b50..1c4b54a080 100644 --- a/osu.Game/Overlays/Options/OptionSlider.cs +++ b/osu.Game/Overlays/Options/OptionSlider.cs @@ -34,7 +34,7 @@ namespace osu.Game.Overlays.Options set { bindable = value; - slider.Current = bindable; + slider.Current.BindTo(bindable); if (value?.Disabled ?? true) Alpha = 0.3f; } diff --git a/osu.Game/Overlays/Options/OptionTextBox.cs b/osu.Game/Overlays/Options/OptionTextBox.cs index c2c8e91016..b5ef39c8b2 100644 --- a/osu.Game/Overlays/Options/OptionTextBox.cs +++ b/osu.Game/Overlays/Options/OptionTextBox.cs @@ -15,7 +15,7 @@ namespace osu.Game.Overlays.Options set { bindable = value; - Current = bindable; + Current.BindTo(bindable); if (value?.Disabled ?? true) Alpha = 0.3f; } From b1d5a563099f89ee9fa2afaf1dbb572aa8791ffb Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Mon, 10 Apr 2017 19:44:45 +0900 Subject: [PATCH 5/5] Update framework. --- osu-framework | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu-framework b/osu-framework index 561b24bed4..1490f00327 160000 --- a/osu-framework +++ b/osu-framework @@ -1 +1 @@ -Subproject commit 561b24bed48d3670b1d33acfc7ba5e11dcd3ac0c +Subproject commit 1490f003273d7aab6589e489f6e4b02d204c9f27