mirror of https://github.com/ppy/osu
Simplify Keywords usage for SettingsSubsection
This commit is contained in:
parent
f3d9abc84a
commit
6b3010535f
|
@ -1,6 +1,8 @@
|
|||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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 @@ public class VolumeSettings : SettingsSubsection
|
|||
{
|
||||
protected override string Header => "Volume";
|
||||
|
||||
public override IEnumerable<string> FilterTerms => base.FilterTerms.Concat(new[] { "Sound" });
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(AudioManager audio, OsuConfigManager config)
|
||||
{
|
||||
|
@ -22,8 +26,6 @@ private void load(AudioManager audio, OsuConfigManager config)
|
|||
new SettingsSlider<double> { LabelText = "Effect", Bindable = audio.VolumeSample, KeyboardStep = 0.01f },
|
||||
new SettingsSlider<double> { LabelText = "Music", Bindable = audio.VolumeTrack, KeyboardStep = 0.01f },
|
||||
};
|
||||
|
||||
Keywords = new[] { "Sound" };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. 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 @@ public class RendererSettings : SettingsSubsection
|
|||
{
|
||||
protected override string Header => "Renderer";
|
||||
|
||||
public override IEnumerable<string> FilterTerms => base.FilterTerms.Concat(new[] { "FPS" });
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(FrameworkConfigManager config, OsuConfigManager osuConfig)
|
||||
{
|
||||
|
@ -30,8 +34,6 @@ private void load(FrameworkConfigManager config, OsuConfigManager osuConfig)
|
|||
Bindable = osuConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay)
|
||||
},
|
||||
};
|
||||
|
||||
Keywords = new[] { "fps" };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -21,10 +21,7 @@ public abstract class SettingsSubsection : FillFlowContainer, IHasFilterableChil
|
|||
protected abstract string Header { get; }
|
||||
|
||||
public IEnumerable<IFilterable> FilterableChildren => Children.OfType<IFilterable>();
|
||||
|
||||
public virtual IEnumerable<string> FilterTerms => Keywords == null ? new[] { Header } : new List<string>(Keywords) { Header }.ToArray();
|
||||
|
||||
public IEnumerable<string> Keywords { get; set; }
|
||||
public virtual IEnumerable<string> FilterTerms => new[] { Header };
|
||||
|
||||
public bool MatchingFilter
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue