mirror of
https://github.com/ppy/osu.git
synced 2025-02-13 14:13:18 +08:00
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 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
{
|
||||
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 @@ namespace osu.Game.Overlays.Settings.Sections.Audio
|
||||
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 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
{
|
||||
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 @@ namespace osu.Game.Overlays.Settings.Sections.Graphics
|
||||
Bindable = osuConfig.GetBindable<bool>(OsuSetting.ShowFpsDisplay)
|
||||
},
|
||||
};
|
||||
|
||||
Keywords = new[] { "fps" };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -21,10 +21,7 @@ namespace osu.Game.Overlays.Settings
|
||||
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
Block a user