From fb94cd43a48c181a7134eab66d1e4b47704c8247 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 25 Jun 2019 12:00:05 +0900 Subject: [PATCH 1/3] Remove unnecessary local item storage in SettingsDropdown --- .../Sections/Audio/AudioDevicesSettings.cs | 2 +- .../Sections/Graphics/LayoutSettings.cs | 2 +- .../Overlays/Settings/Sections/SkinSection.cs | 2 +- .../Overlays/Settings/SettingsDropdown.cs | 26 ++++--------------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs index 7f7545eee3..2c25808170 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/AudioDevicesSettings.cs @@ -73,7 +73,7 @@ namespace osu.Game.Overlays.Settings.Sections.Audio private class AudioDeviceSettingsDropdown : SettingsDropdown { - protected override OsuDropdown CreateDropdown() => new AudioDeviceDropdownControl { Items = Items }; + protected override OsuDropdown CreateDropdown() => new AudioDeviceDropdownControl(); private class AudioDeviceDropdownControl : DropdownControl { diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 36c4fb5252..f4de4c0c41 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -237,7 +237,7 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics private class ResolutionSettingsDropdown : SettingsDropdown { - protected override OsuDropdown CreateDropdown() => new ResolutionDropdownControl { Items = Items }; + protected override OsuDropdown CreateDropdown() => new ResolutionDropdownControl(); private class ResolutionDropdownControl : DropdownControl { diff --git a/osu.Game/Overlays/Settings/Sections/SkinSection.cs b/osu.Game/Overlays/Settings/Sections/SkinSection.cs index 100022bd13..51c687314a 100644 --- a/osu.Game/Overlays/Settings/Sections/SkinSection.cs +++ b/osu.Game/Overlays/Settings/Sections/SkinSection.cs @@ -108,7 +108,7 @@ namespace osu.Game.Overlays.Settings.Sections private class SkinSettingsDropdown : SettingsDropdown { - protected override OsuDropdown CreateDropdown() => new SkinDropdownControl { Items = Items }; + protected override OsuDropdown CreateDropdown() => new SkinDropdownControl(); private class SkinDropdownControl : DropdownControl { diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index de3f741cd7..167061f485 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -13,39 +13,23 @@ namespace osu.Game.Overlays.Settings { protected new OsuDropdown Control => (OsuDropdown)base.Control; - private IEnumerable items = Enumerable.Empty(); - public IEnumerable Items { - get => items; - set - { - items = value; - - if (Control != null) - Control.Items = value; - } + get => Control.Items; + set => Control.Items = value; } - private IBindableList itemSource; - public IBindableList ItemSource { - get => itemSource; - set - { - itemSource = value; - - if (Control != null) - Control.ItemSource = value; - } + get => Control.ItemSource; + set => Control.ItemSource = value; } public override IEnumerable FilterTerms => base.FilterTerms.Concat(Control.Items.Select(i => i.ToString())); protected sealed override Drawable CreateControl() => CreateDropdown(); - protected virtual OsuDropdown CreateDropdown() => new DropdownControl { Items = Items, ItemSource = ItemSource }; + protected virtual OsuDropdown CreateDropdown() => new DropdownControl(); protected class DropdownControl : OsuDropdown { From 0d98d637b61be126cad8626beddf0174988e2240 Mon Sep 17 00:00:00 2001 From: smoogipoo Date: Tue, 25 Jun 2019 15:47:32 +0900 Subject: [PATCH 2/3] Fix cursor expansion state potentially being incorrect --- osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs index d72c334ed3..893c7875fa 100644 --- a/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs +++ b/osu.Game.Rulesets.Osu/UI/Cursor/OsuCursorContainer.cs @@ -1,6 +1,7 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System; using osu.Framework.Allocation; using osu.Framework.Bindables; using osu.Framework.Graphics; @@ -73,7 +74,10 @@ namespace osu.Game.Rulesets.Osu.UI.Cursor { case OsuAction.LeftButton: case OsuAction.RightButton: - if (--downCount == 0) + // Todo: Math.Max() is required as a temporary measure to address https://github.com/ppy/osu-framework/issues/2576 + downCount = Math.Max(0, downCount - 1); + + if (downCount == 0) updateExpandedState(); break; } From 93b6d5b7e3a85fa08537b6ebd1c6fe2596fa28f8 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 25 Jun 2019 17:16:19 +0900 Subject: [PATCH 3/3] Fix keybindings being offset --- osu.Game/Input/Bindings/GlobalActionContainer.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/osu.Game/Input/Bindings/GlobalActionContainer.cs b/osu.Game/Input/Bindings/GlobalActionContainer.cs index 904aa9c8c0..14d356f889 100644 --- a/osu.Game/Input/Bindings/GlobalActionContainer.cs +++ b/osu.Game/Input/Bindings/GlobalActionContainer.cs @@ -95,9 +95,6 @@ namespace osu.Game.Input.Bindings [Description("Quick retry (hold)")] QuickRetry, - [Description("Quick exit (Hold)")] - QuickExit, - [Description("Take screenshot")] TakeScreenshot, @@ -115,5 +112,8 @@ namespace osu.Game.Input.Bindings [Description("Select")] Select, + + [Description("Quick exit (Hold)")] + QuickExit, } }