From b87f89986a5b2bb5fd73a43ba04459df84f92417 Mon Sep 17 00:00:00 2001 From: Joehu Date: Sat, 19 Dec 2020 16:57:25 -0800 Subject: [PATCH 1/3] Fix selected item not being highlighted on some setting dropdowns --- .../Settings/Sections/Graphics/LayoutSettings.cs | 3 +-- .../Sections/UserInterface/MainMenuSettings.cs | 11 +++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 62dc1dc806..3df2a78552 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -59,11 +59,10 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics Children = new Drawable[] { - windowModeDropdown = new SettingsDropdown + windowModeDropdown = new SettingsEnumDropdown { LabelText = "Screen mode", Current = config.GetBindable(FrameworkSetting.WindowMode), - ItemSource = windowModes, }, resolutionSettingsContainer = new Container { diff --git a/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs b/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs index 598b666642..95e2e9da30 100644 --- a/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/UserInterface/MainMenuSettings.cs @@ -1,8 +1,6 @@ // 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 System.Linq; using osu.Framework.Allocation; using osu.Framework.Graphics; using osu.Game.Configuration; @@ -28,23 +26,20 @@ namespace osu.Game.Overlays.Settings.Sections.UserInterface LabelText = "osu! music theme", Current = config.GetBindable(OsuSetting.MenuMusic) }, - new SettingsDropdown + new SettingsEnumDropdown { LabelText = "Intro sequence", Current = config.GetBindable(OsuSetting.IntroSequence), - Items = Enum.GetValues(typeof(IntroSequence)).Cast() }, - new SettingsDropdown + new SettingsEnumDropdown { LabelText = "Background source", Current = config.GetBindable(OsuSetting.MenuBackgroundSource), - Items = Enum.GetValues(typeof(BackgroundSource)).Cast() }, - new SettingsDropdown + new SettingsEnumDropdown { LabelText = "Seasonal backgrounds", Current = config.GetBindable(OsuSetting.SeasonalBackgroundMode), - Items = Enum.GetValues(typeof(SeasonalBackgroundMode)).Cast() } }; } From 5b8e35c98cec02b359eb2cf598713638538d349a Mon Sep 17 00:00:00 2001 From: Joehu Date: Sat, 19 Dec 2020 16:57:42 -0800 Subject: [PATCH 2/3] Make settings dropdown abstract --- osu.Game/Overlays/Settings/SettingsDropdown.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index 1175ddaab8..e1c6333aa0 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { - public class SettingsDropdown : SettingsItem + public abstract class SettingsDropdown : SettingsItem { protected new OsuDropdown Control => (OsuDropdown)base.Control; From 7c5964fad8471635aa98a4fa1f81ef43ee9d5351 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Tue, 22 Dec 2020 13:04:39 +0900 Subject: [PATCH 3/3] Revert window modes to previous code to correctly apply framework restrictions --- osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs | 3 ++- osu.Game/Overlays/Settings/SettingsDropdown.cs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs index 3df2a78552..3ef60c8fcd 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/LayoutSettings.cs @@ -59,9 +59,10 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics Children = new Drawable[] { - windowModeDropdown = new SettingsEnumDropdown + windowModeDropdown = new SettingsDropdown { LabelText = "Screen mode", + ItemSource = windowModes, Current = config.GetBindable(FrameworkSetting.WindowMode), }, resolutionSettingsContainer = new Container diff --git a/osu.Game/Overlays/Settings/SettingsDropdown.cs b/osu.Game/Overlays/Settings/SettingsDropdown.cs index e1c6333aa0..1175ddaab8 100644 --- a/osu.Game/Overlays/Settings/SettingsDropdown.cs +++ b/osu.Game/Overlays/Settings/SettingsDropdown.cs @@ -9,7 +9,7 @@ using osu.Game.Graphics.UserInterface; namespace osu.Game.Overlays.Settings { - public abstract class SettingsDropdown : SettingsItem + public class SettingsDropdown : SettingsItem { protected new OsuDropdown Control => (OsuDropdown)base.Control;