mirror of
https://github.com/osukey/osukey.git
synced 2025-06-27 14:18:06 +09:00
Add support for externally specified keywords in SettingsButton
s
This commit is contained in:
parent
f87bb589a2
commit
2ed9fe3747
@ -1,8 +1,8 @@
|
|||||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
// 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.
|
// See the LICENCE file in the repository root for full licence text.
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
|
||||||
using osu.Framework.Bindables;
|
using osu.Framework.Bindables;
|
||||||
using osu.Framework.Graphics;
|
using osu.Framework.Graphics;
|
||||||
using osu.Framework.Graphics.Containers;
|
using osu.Framework.Graphics.Containers;
|
||||||
@ -22,6 +22,8 @@ namespace osu.Game.Overlays.Settings
|
|||||||
|
|
||||||
public LocalisableString TooltipText { get; set; }
|
public LocalisableString TooltipText { get; set; }
|
||||||
|
|
||||||
|
public IEnumerable<string> Keywords { get; set; } = Array.Empty<string>();
|
||||||
|
|
||||||
public BindableBool CanBeShown { get; } = new BindableBool(true);
|
public BindableBool CanBeShown { get; } = new BindableBool(true);
|
||||||
IBindable<bool> IConditionalFilterable.CanBeShown => CanBeShown;
|
IBindable<bool> IConditionalFilterable.CanBeShown => CanBeShown;
|
||||||
|
|
||||||
@ -30,9 +32,13 @@ namespace osu.Game.Overlays.Settings
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (TooltipText != default)
|
if (TooltipText != default)
|
||||||
return base.FilterTerms.Append(TooltipText);
|
yield return TooltipText;
|
||||||
|
|
||||||
return base.FilterTerms;
|
foreach (string s in Keywords)
|
||||||
|
yield return s;
|
||||||
|
|
||||||
|
foreach (LocalisableString s in base.FilterTerms)
|
||||||
|
yield return s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user