2020-02-10 12:43:11 +00: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.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics;
|
|
|
|
|
using osu.Game.Graphics.UserInterface;
|
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osuTK;
|
2020-07-27 21:43:06 +00:00
|
|
|
|
using osu.Framework.Allocation;
|
2020-02-10 12:43:11 +00:00
|
|
|
|
|
2020-07-27 21:43:06 +00:00
|
|
|
|
namespace osu.Game.Overlays.Comments.Buttons
|
2020-02-10 12:43:11 +00:00
|
|
|
|
{
|
2020-07-30 02:02:01 +00:00
|
|
|
|
public class ShowMoreRepliesButton : LoadingButton
|
2020-02-10 12:43:11 +00:00
|
|
|
|
{
|
|
|
|
|
protected override IEnumerable<Drawable> EffectTargets => new[] { text };
|
|
|
|
|
|
|
|
|
|
private OsuSpriteText text;
|
|
|
|
|
|
2020-07-30 02:02:01 +00:00
|
|
|
|
public ShowMoreRepliesButton()
|
2020-02-10 12:43:11 +00:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
LoadingAnimationSize = new Vector2(8);
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-27 21:43:06 +00:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
|
|
|
|
{
|
|
|
|
|
IdleColour = colourProvider.Light2;
|
|
|
|
|
HoverColour = colourProvider.Light1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 12:43:11 +00:00
|
|
|
|
protected override Drawable CreateContent() => new Container
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Child = text = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
AlwaysPresent = true,
|
2020-07-27 21:43:06 +00:00
|
|
|
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
|
|
|
|
|
Text = "show more"
|
2020-02-10 12:43:11 +00:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-07-27 21:43:06 +00:00
|
|
|
|
protected override void OnLoadStarted() => text.FadeOut(200, Easing.OutQuint);
|
2020-02-10 12:43:11 +00:00
|
|
|
|
|
2020-07-27 21:43:06 +00:00
|
|
|
|
protected override void OnLoadFinished() => text.FadeIn(200, Easing.OutQuint);
|
2020-02-10 12:43:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|