From 6b3010535fc289d2e5d1cd0c7836302e78122911 Mon Sep 17 00:00:00 2001 From: Andrei Zavatski Date: Wed, 20 Nov 2019 21:03:31 +0300 Subject: [PATCH] Simplify Keywords usage for SettingsSubsection --- osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs | 6 ++++-- .../Overlays/Settings/Sections/Graphics/RendererSettings.cs | 6 ++++-- osu.Game/Overlays/Settings/SettingsSubsection.cs | 5 +---- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs index c297f694c0..7bfec0fad8 100644 --- a/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Audio/VolumeSettings.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Audio; using osu.Framework.Graphics; @@ -12,6 +14,8 @@ namespace osu.Game.Overlays.Settings.Sections.Audio { protected override string Header => "Volume"; + public override IEnumerable FilterTerms => base.FilterTerms.Concat(new[] { "Sound" }); + [BackgroundDependencyLoader] private void load(AudioManager audio, OsuConfigManager config) { @@ -22,8 +26,6 @@ namespace osu.Game.Overlays.Settings.Sections.Audio new SettingsSlider { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.01f }, new SettingsSlider { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.01f }, }; - - Keywords = new[] { "Sound" }; } } } diff --git a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs index 1aee9a8efe..92f4823142 100644 --- a/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs +++ b/osu.Game/Overlays/Settings/Sections/Graphics/RendererSettings.cs @@ -1,6 +1,8 @@ // Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. +using System.Collections.Generic; +using System.Linq; using osu.Framework.Allocation; using osu.Framework.Configuration; using osu.Framework.Graphics; @@ -12,6 +14,8 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics { protected override string Header => "Renderer"; + public override IEnumerable FilterTerms => base.FilterTerms.Concat(new[] { "FPS" }); + [BackgroundDependencyLoader] private void load(FrameworkConfigManager config, OsuConfigManager osuConfig) { @@ -30,8 +34,6 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics Bindable = osuConfig.GetBindable(OsuSetting.ShowFpsDisplay) }, }; - - Keywords = new[] { "fps" }; } } } diff --git a/osu.Game/Overlays/Settings/SettingsSubsection.cs b/osu.Game/Overlays/Settings/SettingsSubsection.cs index 15f20d252c..9b3b2f570c 100644 --- a/osu.Game/Overlays/Settings/SettingsSubsection.cs +++ b/osu.Game/Overlays/Settings/SettingsSubsection.cs @@ -21,10 +21,7 @@ namespace osu.Game.Overlays.Settings protected abstract string Header { get; } public IEnumerable FilterableChildren => Children.OfType(); - - public virtual IEnumerable FilterTerms => Keywords == null ? new[] { Header } : new List(Keywords) { Header }.ToArray(); - - public IEnumerable Keywords { get; set; } + public virtual IEnumerable FilterTerms => new[] { Header }; public bool MatchingFilter {