From 2bc3464802c75a45ee5cfc852de2acd0e618d8fb Mon Sep 17 00:00:00 2001 From: ekrctb Date: Thu, 17 Jan 2019 17:27:34 +0900 Subject: [PATCH 1/4] Hide Room tab when Settings tab is active --- osu.Game/Screens/Multi/Match/MatchSubScreen.cs | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index 14cdd90128..bc3b2c74d4 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -51,6 +51,8 @@ namespace osu.Game.Screens.Multi.Match MatchChatDisplay chat; Components.Header header; + Info info; + GridContainer bottomRow; MatchSettingsOverlay settings; Children = new Drawable[] @@ -61,10 +63,10 @@ namespace osu.Game.Screens.Multi.Match Content = new[] { new Drawable[] { header = new Components.Header(room) { Depth = -1 } }, - new Drawable[] { new Info(room) { OnStart = onStart } }, + new Drawable[] { info = new Info(room) { OnStart = onStart } }, new Drawable[] { - new GridContainer + bottomRow = new GridContainer { RelativeSizeAxes = Axes.Both, Content = new[] @@ -110,9 +112,17 @@ namespace osu.Game.Screens.Multi.Match header.Tabs.Current.ValueChanged += t => { if (t is SettingsMatchPage) + { settings.Show(); + info.Hide(); + bottomRow.Hide(); + } else + { settings.Hide(); + info.Show(); + bottomRow.Show(); + } }; chat.Exit += Exit; From 491537b8ba7c9e2a5fc408a56f931d7937c5de69 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 18:13:05 +0900 Subject: [PATCH 2/4] Add fade duration Not really visible in the existing usage, but once we enable the settings tab it will be required. Tested by manually enabling it. --- osu.Game/Screens/Multi/Match/MatchSubScreen.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs index bc3b2c74d4..a7932e1131 100644 --- a/osu.Game/Screens/Multi/Match/MatchSubScreen.cs +++ b/osu.Game/Screens/Multi/Match/MatchSubScreen.cs @@ -111,17 +111,18 @@ namespace osu.Game.Screens.Multi.Match header.OnRequestSelectBeatmap = () => Push(new MatchSongSelect { Selected = addPlaylistItem }); header.Tabs.Current.ValueChanged += t => { + const float fade_duration = 500; if (t is SettingsMatchPage) { settings.Show(); - info.Hide(); - bottomRow.Hide(); + info.FadeOut(fade_duration, Easing.OutQuint); + bottomRow.FadeOut(fade_duration, Easing.OutQuint); } else { settings.Hide(); - info.Show(); - bottomRow.Show(); + info.FadeIn(fade_duration, Easing.OutQuint); + bottomRow.FadeIn(fade_duration, Easing.OutQuint); } }; From d16f4af92b35692caa3f43c0a4b3934cd39618d7 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 19:18:40 +0900 Subject: [PATCH 3/4] Use TransferValueOnCommit for mouse sensitivity --- .../Settings/Sections/Input/MouseSettings.cs | 53 +------------------ 1 file changed, 1 insertion(+), 52 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index c4d180790c..be264e8cdf 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -78,66 +78,15 @@ namespace osu.Game.Overlays.Settings.Sections.Input private class SensitivitySetting : SettingsSlider { - public override Bindable Bindable - { - get { return ((SensitivitySlider)Control).Sensitivity; } - - set - { - BindableDouble doubleValue = (BindableDouble)value; - - // create a second layer of bindable so we can only handle state changes when not being dragged. - ((SensitivitySlider)Control).Sensitivity = doubleValue; - - // this bindable will still act as the "interactive" bindable displayed during a drag. - base.Bindable = new BindableDouble(doubleValue.Value) - { - Default = doubleValue.Default, - MinValue = doubleValue.MinValue, - MaxValue = doubleValue.MaxValue - }; - - // one-way binding to update the sliderbar with changes from external actions. - doubleValue.DisabledChanged += disabled => base.Bindable.Disabled = disabled; - doubleValue.ValueChanged += newValue => base.Bindable.Value = newValue; - } - } - public SensitivitySetting() { KeyboardStep = 0.01f; + TransferValueOnCommit = true; } } private class SensitivitySlider : OsuSliderBar { - public Bindable Sensitivity; - - public SensitivitySlider() - { - Current.ValueChanged += newValue => - { - if (!isDragging && Sensitivity != null) - Sensitivity.Value = newValue; - }; - } - - private bool isDragging; - - protected override bool OnDragStart(DragStartEvent e) - { - isDragging = true; - return base.OnDragStart(e); - } - - protected override bool OnDragEnd(DragEndEvent e) - { - isDragging = false; - Current.TriggerChange(); - - return base.OnDragEnd(e); - } - public override string TooltipText => Current.Disabled ? "Enable raw input to adjust sensitivity" : Current.Value.ToString(@"0.##x"); } } From 93a08bdb2384ef078197b49506cf1a701c2e063c Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Thu, 17 Jan 2019 20:23:15 +0900 Subject: [PATCH 4/4] Remove stray using --- osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs index be264e8cdf..e5cde37254 100644 --- a/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Input/MouseSettings.cs @@ -5,7 +5,6 @@ using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; using osu.Framework.Input; -using osu.Framework.Input.Events; using osu.Game.Configuration; using osu.Game.Graphics.UserInterface;