mirror of
https://github.com/ppy/osu
synced 2025-03-22 10:56:54 +00:00
Update existing triangle buttons to use RoundedButton
This commit is contained in:
parent
40f706155f
commit
4fbca4037c
@ -1,42 +1,14 @@
|
|||||||
// 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.
|
||||||
|
|
||||||
#nullable disable
|
using osu.Game.Graphics.UserInterfaceV2;
|
||||||
|
|
||||||
using System.Collections.Generic;
|
|
||||||
using osu.Framework.Allocation;
|
|
||||||
using osu.Framework.Graphics;
|
|
||||||
using osu.Framework.Graphics.Containers;
|
|
||||||
using osu.Framework.Localisation;
|
|
||||||
using osu.Game.Graphics.Backgrounds;
|
|
||||||
|
|
||||||
namespace osu.Game.Graphics.UserInterface
|
namespace osu.Game.Graphics.UserInterface
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// A button with moving triangles in the background.
|
/// A button with moving triangles in the background.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public class TriangleButton : OsuButton, IFilterable
|
public class TriangleButton : RoundedButton
|
||||||
{
|
{
|
||||||
protected Triangles Triangles { get; private set; }
|
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
|
||||||
private void load(OsuColour colours)
|
|
||||||
{
|
|
||||||
Add(Triangles = new Triangles
|
|
||||||
{
|
|
||||||
RelativeSizeAxes = Axes.Both,
|
|
||||||
ColourDark = colours.BlueDarker,
|
|
||||||
ColourLight = colours.Blue,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual IEnumerable<LocalisableString> FilterTerms => new[] { Text };
|
|
||||||
|
|
||||||
public bool MatchingFilter
|
|
||||||
{
|
|
||||||
set => this.FadeTo(value ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
public bool FilteringActive { get; set; }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user