2019-01-24 17:43:03 +09: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 18:19:50 +09:00
|
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2019-02-15 11:56:33 +09:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
2022-05-24 17:50:23 +09:00
|
|
|
|
using JetBrains.Annotations;
|
|
|
|
|
using osu.Framework.Allocation;
|
2017-10-21 13:16:06 +10:30
|
|
|
|
using osu.Framework.Graphics;
|
2019-02-15 11:56:33 +09:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2021-06-25 19:10:04 +02:00
|
|
|
|
using osu.Framework.Localisation;
|
2022-05-24 17:50:23 +09:00
|
|
|
|
using osu.Game.Graphics;
|
2021-10-10 20:32:56 +02:00
|
|
|
|
using osu.Game.Graphics.UserInterfaceV2;
|
2018-04-13 18:19:50 +09:00
|
|
|
|
|
2017-10-21 13:22:21 +10:30
|
|
|
|
namespace osu.Game.Overlays.Settings
|
2017-10-21 13:16:06 +10:30
|
|
|
|
{
|
2021-10-10 20:32:56 +02:00
|
|
|
|
public class SettingsButton : RoundedButton, IHasTooltip
|
2017-10-21 13:16:06 +10:30
|
|
|
|
{
|
|
|
|
|
public SettingsButton()
|
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
2019-05-14 10:45:05 +09:00
|
|
|
|
Padding = new MarginPadding { Left = SettingsPanel.CONTENT_MARGINS, Right = SettingsPanel.CONTENT_MARGINS };
|
2017-10-21 13:16:06 +10:30
|
|
|
|
}
|
2019-02-15 11:56:33 +09:00
|
|
|
|
|
2022-05-24 17:50:23 +09:00
|
|
|
|
[BackgroundDependencyLoader(true)]
|
|
|
|
|
private void load([CanBeNull] OverlayColourProvider overlayColourProvider, OsuColour colours)
|
|
|
|
|
{
|
|
|
|
|
DefaultBackgroundColour = overlayColourProvider?.Highlight1 ?? colours.Blue3;
|
|
|
|
|
}
|
|
|
|
|
|
2021-06-25 19:10:04 +02:00
|
|
|
|
public LocalisableString TooltipText { get; set; }
|
2019-02-15 11:56:33 +09:00
|
|
|
|
|
2022-05-16 14:09:37 +09:00
|
|
|
|
public override IEnumerable<LocalisableString> FilterTerms
|
2019-02-15 11:56:33 +09:00
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2021-06-25 19:10:04 +02:00
|
|
|
|
if (TooltipText != default)
|
2022-05-16 14:09:37 +09:00
|
|
|
|
return base.FilterTerms.Append(TooltipText);
|
2019-02-15 11:56:33 +09:00
|
|
|
|
|
|
|
|
|
return base.FilterTerms;
|
|
|
|
|
}
|
|
|
|
|
}
|
2017-10-21 13:16:06 +10:30
|
|
|
|
}
|
|
|
|
|
}
|