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
|
|
|
|
|
2018-11-20 15:51:59 +08:00
|
|
|
|
using osuTK;
|
|
|
|
|
using osuTK.Graphics;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Framework.Extensions.Color4Extensions;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2018-10-02 11:02:47 +08:00
|
|
|
|
using osu.Framework.Input.Events;
|
2018-04-13 17:19:50 +08:00
|
|
|
|
using osu.Game.Users;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Social
|
|
|
|
|
{
|
|
|
|
|
public class SocialPanel : UserPanel
|
|
|
|
|
{
|
|
|
|
|
private const double hover_transition_time = 400;
|
|
|
|
|
|
2019-02-28 12:31:40 +08:00
|
|
|
|
public SocialPanel(User user)
|
|
|
|
|
: base(user)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private readonly EdgeEffectParameters edgeEffectNormal = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Offset = new Vector2(0f, 1f),
|
|
|
|
|
Radius = 2f,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.25f),
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
private readonly EdgeEffectParameters edgeEffectHovered = new EdgeEffectParameters
|
|
|
|
|
{
|
|
|
|
|
Type = EdgeEffectType.Shadow,
|
|
|
|
|
Offset = new Vector2(0f, 5f),
|
|
|
|
|
Radius = 10f,
|
|
|
|
|
Colour = Color4.Black.Opacity(0.3f),
|
|
|
|
|
};
|
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override bool OnHover(HoverEvent e)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Content.TweenEdgeEffectTo(edgeEffectHovered, hover_transition_time, Easing.OutQuint);
|
|
|
|
|
Content.MoveToY(-4, hover_transition_time, Easing.OutQuint);
|
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
return base.OnHover(e);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
protected override void OnHoverLost(HoverLostEvent e)
|
2018-04-13 17:19:50 +08:00
|
|
|
|
{
|
|
|
|
|
Content.TweenEdgeEffectTo(edgeEffectNormal, hover_transition_time, Easing.OutQuint);
|
|
|
|
|
Content.MoveToY(0, hover_transition_time, Easing.OutQuint);
|
|
|
|
|
|
2018-10-02 11:02:47 +08:00
|
|
|
|
base.OnHoverLost(e);
|
2018-04-13 17:19:50 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
protected override void LoadComplete()
|
|
|
|
|
{
|
|
|
|
|
base.LoadComplete();
|
|
|
|
|
this.FadeInFromZero(200, Easing.Out);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|