1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-06 19:57:24 +08:00
osu-lazer/osu.Game.Tests/Visual/Online/TestSceneHomeNewsPanel.cs

62 lines
2.5 KiB
C#
Raw Normal View History

2020-08-07 16:33:02 +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.
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics;
using osu.Game.Online.API.Requests.Responses;
using osu.Framework.Allocation;
using osu.Game.Overlays;
using System;
using osu.Game.Overlays.Dashboard.Home.News;
2020-08-07 17:59:45 +08:00
using osuTK;
using System.Collections.Generic;
2020-08-07 16:33:02 +08:00
namespace osu.Game.Tests.Visual.Online
{
public class TestSceneHomeNewsPanel : OsuTestScene
{
[Cached]
private readonly OverlayColourProvider overlayColour = new OverlayColourProvider(OverlayColourScheme.Purple);
public TestSceneHomeNewsPanel()
{
2020-08-07 17:59:45 +08:00
Add(new FillFlowContainer
2020-08-07 16:33:02 +08:00
{
Anchor = Anchor.Centre,
Origin = Anchor.Centre,
AutoSizeAxes = Axes.Y,
Width = 500,
2020-08-07 17:59:45 +08:00
Direction = FillDirection.Vertical,
Spacing = new Vector2(0, 5),
Children = new Drawable[]
2020-08-07 16:33:02 +08:00
{
2020-08-12 16:24:26 +08:00
new FeaturedNewsItemPanel(new APINewsPost
2020-08-07 17:59:45 +08:00
{
Title = "This post has an image which starts with \"/\" and has many authors!",
Preview = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
FirstImage = "/help/wiki/shared/news/banners/monthly-beatmapping-contest.png",
PublishedAt = DateTimeOffset.Now,
Slug = "2020-07-16-summer-theme-park-2020-voting-open"
}),
2020-08-12 16:24:26 +08:00
new NewsItemGroupPanel(new List<APINewsPost>
2020-08-07 17:59:45 +08:00
{
new APINewsPost
{
Title = "Title 1",
Slug = "2020-07-16-summer-theme-park-2020-voting-open",
PublishedAt = DateTimeOffset.Now,
},
new APINewsPost
{
Title = "Title of this post is Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.",
Slug = "2020-07-16-summer-theme-park-2020-voting-open",
PublishedAt = DateTimeOffset.Now,
}
2020-08-07 18:18:31 +08:00
}),
2020-08-12 16:24:26 +08:00
new ShowMoreNewsPanel()
2020-08-07 17:59:45 +08:00
}
2020-08-07 16:33:02 +08:00
});
}
}
}