2020-08-07 18:18:31 +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-08-07 18:18:31 +08:00
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
|
using osu.Game.Graphics.Containers;
|
|
|
|
|
using osu.Game.Graphics.Sprites;
|
2022-01-28 12:53:48 +08:00
|
|
|
|
using osu.Game.Resources.Localisation.Web;
|
2020-08-07 18:18:31 +08:00
|
|
|
|
using osuTK.Graphics;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Overlays.Dashboard.Home.News
|
|
|
|
|
{
|
2020-08-12 16:24:26 +08:00
|
|
|
|
public class ShowMoreNewsPanel : OsuHoverContainer
|
2020-08-07 18:18:31 +08:00
|
|
|
|
{
|
|
|
|
|
protected override IEnumerable<Drawable> EffectTargets => new[] { text };
|
|
|
|
|
|
|
|
|
|
[Resolved(canBeNull: true)]
|
|
|
|
|
private NewsOverlay overlay { get; set; }
|
|
|
|
|
|
|
|
|
|
private OsuSpriteText text;
|
|
|
|
|
|
2020-08-12 16:24:26 +08:00
|
|
|
|
public ShowMoreNewsPanel()
|
2020-08-07 18:18:31 +08:00
|
|
|
|
{
|
|
|
|
|
RelativeSizeAxes = Axes.X;
|
|
|
|
|
AutoSizeAxes = Axes.Y;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(OverlayColourProvider colourProvider)
|
|
|
|
|
{
|
|
|
|
|
Child = new HomePanel
|
|
|
|
|
{
|
|
|
|
|
Child = text = new OsuSpriteText
|
|
|
|
|
{
|
|
|
|
|
Anchor = Anchor.Centre,
|
|
|
|
|
Origin = Anchor.Centre,
|
|
|
|
|
Margin = new MarginPadding { Vertical = 20 },
|
2022-01-28 12:53:48 +08:00
|
|
|
|
Text = CommonStrings.ButtonsSeeMore
|
2020-08-07 18:18:31 +08:00
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
IdleColour = colourProvider.Light1;
|
|
|
|
|
HoverColour = Color4.White;
|
|
|
|
|
|
|
|
|
|
Action = () =>
|
|
|
|
|
{
|
|
|
|
|
overlay?.ShowFrontPage();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|