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.
|
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2019-06-04 23:14:03 +08:00
|
|
|
|
using osu.Framework.Graphics;
|
2022-04-30 20:35:04 +08:00
|
|
|
|
using osu.Framework.Graphics.Cursor;
|
2019-06-04 23:14:03 +08:00
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
2022-04-30 20:35:04 +08:00
|
|
|
|
using osu.Framework.Localisation;
|
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2019-06-04 23:14:03 +08:00
|
|
|
|
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;
|
|
|
|
|
|
2022-04-29 17:19:47 +08:00
|
|
|
|
icon.Alpha = isDefault ? 1 : 0;
|
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)
|
|
|
|
|
{
|
2022-04-30 20:35:04 +08:00
|
|
|
|
Add(icon = new DefaultRulesetIcon { Alpha = 0 });
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class DefaultRulesetIcon : SpriteIcon, IHasTooltip
|
|
|
|
|
{
|
|
|
|
|
public LocalisableString TooltipText => UsersStrings.ShowEditDefaultPlaymodeIsDefaultTooltip;
|
|
|
|
|
|
|
|
|
|
public DefaultRulesetIcon()
|
2019-06-04 23:14:03 +08:00
|
|
|
|
{
|
2022-04-30 20:35:04 +08:00
|
|
|
|
Origin = Anchor.Centre;
|
|
|
|
|
Anchor = Anchor.Centre;
|
|
|
|
|
Icon = FontAwesome.Solid.Star;
|
|
|
|
|
Size = new Vector2(12);
|
|
|
|
|
}
|
2020-01-04 02:02:56 +08:00
|
|
|
|
}
|
2019-06-04 23:14:03 +08:00
|
|
|
|
}
|
|
|
|
|
}
|