2019-01-24 16:43:03 +08: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 17:19:50 +08:00
|
|
|
|
|
2017-11-26 00:52:52 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2022-05-16 13:09:37 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
2017-11-26 00:52:52 +08:00
|
|
|
|
using osu.Game.Graphics.Backgrounds;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-11-26 00:52:52 +08:00
|
|
|
|
namespace osu.Game.Graphics.UserInterface
|
|
|
|
|
{
|
2017-11-27 17:26:20 +08:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// A button with moving triangles in the background.
|
|
|
|
|
/// </summary>
|
2017-11-26 00:52:52 +08:00
|
|
|
|
public class TriangleButton : OsuButton, IFilterable
|
|
|
|
|
{
|
2018-08-01 15:45:48 +08:00
|
|
|
|
protected Triangles Triangles { get; private set; }
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-11-26 00:52:52 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
2017-11-26 01:52:55 +08:00
|
|
|
|
private void load(OsuColour colours)
|
2017-11-26 00:52:52 +08:00
|
|
|
|
{
|
2018-08-01 15:45:48 +08:00
|
|
|
|
Add(Triangles = new Triangles
|
2017-11-26 00:52:52 +08:00
|
|
|
|
{
|
2018-08-01 15:45:48 +08:00
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
|
ColourDark = colours.BlueDarker,
|
|
|
|
|
ColourLight = colours.Blue,
|
2017-11-26 00:52:52 +08:00
|
|
|
|
});
|
|
|
|
|
}
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2022-05-16 13:09:37 +08:00
|
|
|
|
public virtual IEnumerable<LocalisableString> FilterTerms => new[] { Text };
|
2018-04-13 17:19:50 +08:00
|
|
|
|
|
2017-11-26 00:52:52 +08:00
|
|
|
|
public bool MatchingFilter
|
|
|
|
|
{
|
2019-02-28 12:58:19 +08:00
|
|
|
|
set => this.FadeTo(value ? 1 : 0);
|
2017-11-26 00:52:52 +08:00
|
|
|
|
}
|
2019-03-28 23:29:07 +08:00
|
|
|
|
|
|
|
|
|
public bool FilteringActive { get; set; }
|
2017-11-26 00:52:52 +08:00
|
|
|
|
}
|
|
|
|
|
}
|