2019-01-24 08:43:03 +00:00
|
|
|
|
// 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.
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2023-01-23 06:10:26 +00:00
|
|
|
|
using System;
|
2019-02-15 02:56:33 +00:00
|
|
|
|
using System.Collections.Generic;
|
2022-11-16 13:58:32 +00:00
|
|
|
|
using osu.Framework.Bindables;
|
2017-10-21 02:46:06 +00:00
|
|
|
|
using osu.Framework.Graphics;
|
2022-11-16 13:58:32 +00:00
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-02-15 02:56:33 +00:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2021-06-25 17:10:04 +00:00
|
|
|
|
using osu.Framework.Localisation;
|
2021-10-10 18:32:56 +00:00
|
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
2018-04-13 09:19:50 +00:00
|
|
|
|
|
2017-10-21 02:52:21 +00:00
|
|
|
|
namespace osu.Game.Overlays.Settings
|
2017-10-21 02:46:06 +00:00
|
|
|
|
{
|
2022-11-16 13:58:32 +00:00
|
|
|
|
public partial class SettingsButton : RoundedButton, IHasTooltip, IConditionalFilterable
|
2017-10-21 02:46:06 +00:00
|
|
|
|
{
|
|
|
|
|
public SettingsButton()
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2019-05-14 01:45:05 +00:00
|
|
|
|
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS, Right = SettingsPanel.CONTENT_MARGINS };
|
2017-10-21 02:46:06 +00:00
|
|
|
|
}
|
2019-02-15 02:56:33 +00:00
|
|
|
|
|
2021-06-25 17:10:04 +00:00
|
|
|
|
public LocalisableString TooltipText { get; set; }
|
2019-02-15 02:56:33 +00:00
|
|
|
|
|
2023-01-23 06:10:26 +00:00
|
|
|
|
public IEnumerable<string> Keywords { get; set; } = Array.Empty<string>();
|
|
|
|
|
|
2022-11-16 13:58:32 +00:00
|
|
|
|
public BindableBool CanBeShown { get; } = new BindableBool(true);
|
|
|
|
|
IBindable<bool> IConditionalFilterable.CanBeShown => CanBeShown;
|
|
|
|
|
|
2022-05-16 05:09:37 +00:00
|
|
|
|
public override IEnumerable<LocalisableString> FilterTerms
|
2019-02-15 02:56:33 +00:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2021-06-25 17:10:04 +00:00
|
|
|
|
if (TooltipText != default)
|
2023-01-23 06:10:26 +00:00
|
|
|
|
yield return TooltipText;
|
|
|
|
|
|
|
|
|
|
foreach (string s in Keywords)
|
|
|
|
|
yield return s;
|
2019-02-15 02:56:33 +00:00
|
|
|
|
|
2023-01-23 06:10:26 +00:00
|
|
|
|
foreach (LocalisableString s in base.FilterTerms)
|
|
|
|
|
yield return s;
|
2019-02-15 02:56:33 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2017-10-21 02:46:06 +00:00
|
|
|
|
}
|
|
|
|
|
}
|