Simplify OverlayRulesetTabItem.AccentColour

This commit is contained in:
Andrei Zavatski
2020-01-30 10:34:22 +03:00
parent 10e8361e7c
commit ea2f66da1d
3 changed files with 27 additions and 53 deletions

View File

@ -1,7 +1,6 @@
// 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.
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Sprites;
using osu.Game.Rulesets;
@ -28,6 +27,16 @@ namespace osu.Game.Overlays.Profile.Header.Components
}
}
protected override Color4 AccentColour
{
get => base.AccentColour;
set
{
base.AccentColour = value;
icon.FadeColour(value, 120, Easing.OutQuint);
}
}
private readonly SpriteIcon icon;
public ProfileRulesetTabItem(RulesetInfo value)
@ -43,11 +52,5 @@ namespace osu.Game.Overlays.Profile.Header.Components
Size = new Vector2(12),
});
}
protected override void OnCurrentColourChanged(ValueChangedEvent<Color4> colour)
{
base.OnCurrentColourChanged(colour);
icon.FadeColour(colour.NewValue, 120, Easing.OutQuint);
}
}
}