2020-02-10 20:43:11 +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.
|
|
|
|
|
|
2022-06-17 15:37:17 +08:00
|
|
|
|
#nullable disable
|
|
|
|
|
|
2020-02-10 20:43:11 +08:00
|
|
|
|
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-28 05:43:06 +08:00
|
|
|
|
using osu.Framework.Allocation;
|
2022-01-28 12:53:48 +08:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2020-02-10 20:43:11 +08:00
|
|
|
|
|
2020-07-28 05:43:06 +08:00
|
|
|
|
namespace osu.Game.Overlays.Comments.Buttons
|
2020-02-10 20:43:11 +08:00
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class ShowMoreRepliesButton : LoadingButton
|
2020-02-10 20:43:11 +08:00
|
|
|
|
{
|
|
|
|
|
protected override IEnumerable<Drawable> EffectTargets => new[] { text };
|
|
|
|
|
|
|
|
|
|
private OsuSpriteText text;
|
|
|
|
|
|
2020-07-30 10:02:01 +08:00
|
|
|
|
public ShowMoreRepliesButton()
|
2020-02-10 20:43:11 +08:00
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
|
LoadingAnimationSize = new Vector2(8);
|
|
|
|
|
}
|
|
|
|
|
|
2020-07-28 05:43:06 +08:00
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
|
|
|
|
{
|
|
|
|
|
IdleColour = colourProvider.Light2;
|
|
|
|
|
HoverColour = colourProvider.Light1;
|
|
|
|
|
}
|
|
|
|
|
|
2020-02-10 20:43:11 +08:00
|
|
|
|
protected override Drawable CreateContent() => new Container
|
|
|
|
|
{
|
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
|
Child = text = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
AlwaysPresent = true,
|
2020-07-28 05:43:06 +08:00
|
|
|
|
Font = OsuFont.GetFont(size: 12, weight: FontWeight.SemiBold),
|
2022-01-28 12:53:48 +08:00
|
|
|
|
Text = CommonStrings.ButtonsShowMore
|
2020-02-10 20:43:11 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
2020-07-28 05:43:06 +08:00
|
|
|
|
protected override void OnLoadStarted() => text.FadeOut(200, Easing.OutQuint);
|
2020-02-10 20:43:11 +08:00
|
|
|
|
|
2020-07-28 05:43:06 +08:00
|
|
|
|
protected override void OnLoadFinished() => text.FadeIn(200, Easing.OutQuint);
|
2020-02-10 20:43:11 +08:00
|
|
|
|
}
|
|
|
|
|
}
|