1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-15 04:27:34 +08:00
osu-lazer/osu.Game/Overlays/Comments/Buttons/ShowMoreRepliesButton.cs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

53 lines
1.6 KiB
C#
Raw Normal View History

// 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
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;
using osu.Game.Resources.Localisation.Web;
2020-07-28 05:43:06 +08:00
namespace osu.Game.Overlays.Comments.Buttons
{
public class ShowMoreRepliesButton : LoadingButton
{
protected override IEnumerable<Drawable> EffectTargets => new[] { text };
private OsuSpriteText text;
public ShowMoreRepliesButton()
{
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;
}
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),
Text = CommonStrings.ButtonsShowMore
}
};
2020-07-28 05:43:06 +08:00
protected override void OnLoadStarted() => text.FadeOut(200, Easing.OutQuint);
2020-07-28 05:43:06 +08:00
protected override void OnLoadFinished() => text.FadeIn(200, Easing.OutQuint);
}
}