1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-15 14:03:01 +08:00

Add NewsContent class and fix broken reference.

This commit is contained in:
Lucas A 2019-08-14 20:24:36 +02:00
parent 7d18132e61
commit 840d4741da
3 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,16 @@
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
namespace osu.Game.Overlays.News
{
public abstract class NewsContent : FillFlowContainer
{
public NewsContent()
{
RelativeSizeAxes = Axes.X;
AutoSizeAxes = Axes.Y;
Direction = FillDirection.Vertical;
Padding = new MarginPadding { Bottom = 100 };
}
}
}

View File

@ -97,7 +97,7 @@ namespace osu.Game.Overlays.News
IsReadingArticle = false;
}
protected override Drawable CreateIcon() => new ScreenTitleIcon(@"Icons/news");
protected override Drawable CreateIcon() => new ScreenTitleTextureIcon(@"Icons/news");
[BackgroundDependencyLoader]
private void load(OsuColour colours)

View File

@ -15,6 +15,7 @@ namespace osu.Game.Overlays
public class NewsOverlay : FullscreenOverlay
{
private NewsHeader header;
private Container<NewsContent> content;
public readonly Bindable<string> Current = new Bindable<string>(null);
@ -39,13 +40,20 @@ namespace osu.Game.Overlays
Children = new Drawable[]
{
header = new NewsHeader()
{
ShowFrontPage = ShowFrontPage
},
content = new Container<NewsContent>()
{
RelativeSizeAxes = Axes.X,
AutoSizeAxes = Axes.Y,
}
},
},
},
};
header.Current.BindTo(Current);
header.ShowFrontPage = ShowFrontPage;
Current.TriggerChange();
}