mirror of
https://github.com/ppy/osu.git
synced 2024-11-18 17:32:55 +08:00
59 lines
1.7 KiB
C#
59 lines
1.7 KiB
C#
// 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.Allocation;
|
|
using osu.Framework.Bindables;
|
|
using osu.Framework.Graphics;
|
|
using osu.Framework.Graphics.Containers;
|
|
using osu.Framework.Graphics.Shapes;
|
|
using osu.Game.Graphics;
|
|
using osu.Game.Graphics.Containers;
|
|
using osu.Game.Overlays.News;
|
|
|
|
namespace osu.Game.Overlays
|
|
{
|
|
public class NewsOverlay : FullscreenOverlay
|
|
{
|
|
private NewsHeader header;
|
|
|
|
public readonly Bindable<string> Current = new Bindable<string>(null);
|
|
|
|
[BackgroundDependencyLoader]
|
|
private void load(OsuColour colours)
|
|
{
|
|
Children = new Drawable[]
|
|
{
|
|
new Box
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Colour = colours.PurpleDarkAlternative
|
|
},
|
|
new OsuScrollContainer
|
|
{
|
|
RelativeSizeAxes = Axes.Both,
|
|
Child = new FillFlowContainer
|
|
{
|
|
RelativeSizeAxes = Axes.X,
|
|
AutoSizeAxes = Axes.Y,
|
|
Direction = FillDirection.Vertical,
|
|
Children = new Drawable[]
|
|
{
|
|
header = new NewsHeader()
|
|
},
|
|
},
|
|
},
|
|
};
|
|
|
|
header.Current.BindTo(Current);
|
|
header.ShowFrontPage = ShowFrontPage;
|
|
Current.TriggerChange();
|
|
}
|
|
|
|
public void ShowFrontPage()
|
|
{
|
|
Current.Value = null;
|
|
Show();
|
|
}
|
|
}
|
|
}
|