2019-06-27 14:31:47 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2019-06-04 23:14:03 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
|
using osu.Game.Rulesets;
|
|
|
|
|
using osuTK;
|
2020-01-04 02:02:56 +08:00
|
|
|
|
using osuTK.Graphics;
|
2019-06-04 23:14:03 +08:00
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Profile.Header.Components
|
|
|
|
|
{
|
2020-01-02 03:55:28 +08:00
|
|
|
|
public class ProfileRulesetTabItem : OverlayRulesetTabItem
|
2019-06-04 23:14:03 +08:00
|
|
|
|
{
|
|
|
|
|
private bool isDefault;
|
|
|
|
|
|
|
|
|
|
public bool IsDefault
|
|
|
|
|
{
|
|
|
|
|
get => isDefault;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (isDefault == value)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
isDefault = value;
|
|
|
|
|
|
2019-06-04 23:37:31 +08:00
|
|
|
|
icon.FadeTo(isDefault ? 1 : 0, 200, Easing.OutQuint);
|
2019-06-04 23:14:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-30 15:34:22 +08:00
|
|
|
|
protected override Color4 AccentColour
|
|
|
|
|
{
|
|
|
|
|
get => base.AccentColour;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
base.AccentColour = value;
|
|
|
|
|
icon.FadeColour(value, 120, Easing.OutQuint);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2020-01-04 02:02:56 +08:00
|
|
|
|
private readonly SpriteIcon icon;
|
|
|
|
|
|
2019-06-27 13:54:31 +08:00
|
|
|
|
public ProfileRulesetTabItem(RulesetInfo value)
|
2019-06-04 23:14:03 +08:00
|
|
|
|
: base(value)
|
|
|
|
|
{
|
2020-01-02 03:55:28 +08:00
|
|
|
|
Add(icon = new SpriteIcon
|
2019-06-04 23:14:03 +08:00
|
|
|
|
{
|
2020-01-02 03:55:28 +08:00
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Alpha = 0,
|
|
|
|
|
AlwaysPresent = true,
|
|
|
|
|
Icon = FontAwesome.Solid.Star,
|
|
|
|
|
Size = new Vector2(12),
|
|
|
|
|
});
|
2020-01-04 02:02:56 +08:00
|
|
|
|
}
|
2019-06-04 23:14:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|