mirror of
https://github.com/ppy/osu.git
synced 2025-01-13 09:23:06 +08:00
Add NewsOverlay to the game
This commit is contained in:
parent
17c598568d
commit
68d2888a8c
@ -44,6 +44,7 @@ namespace osu.Game.Tests.Visual
|
||||
typeof(NotificationOverlay),
|
||||
typeof(BeatmapListingOverlay),
|
||||
typeof(DashboardOverlay),
|
||||
typeof(NewsOverlay),
|
||||
typeof(ChannelManager),
|
||||
typeof(ChatOverlay),
|
||||
typeof(SettingsOverlay),
|
||||
|
@ -71,6 +71,8 @@ namespace osu.Game
|
||||
|
||||
private DashboardOverlay dashboard;
|
||||
|
||||
private NewsOverlay news;
|
||||
|
||||
private UserProfileOverlay userProfile;
|
||||
|
||||
private BeatmapSetOverlay beatmapSetOverlay;
|
||||
@ -630,6 +632,7 @@ namespace osu.Game
|
||||
// overlay elements
|
||||
loadComponentSingleFile(beatmapListing = new BeatmapListingOverlay(), overlayContent.Add, true);
|
||||
loadComponentSingleFile(dashboard = new DashboardOverlay(), overlayContent.Add, true);
|
||||
loadComponentSingleFile(news = new NewsOverlay(), overlayContent.Add, true);
|
||||
var rankingsOverlay = loadComponentSingleFile(new RankingsOverlay(), overlayContent.Add, true);
|
||||
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal, true);
|
||||
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, true);
|
||||
@ -687,7 +690,7 @@ namespace osu.Game
|
||||
}
|
||||
|
||||
// ensure only one of these overlays are open at once.
|
||||
var singleDisplayOverlays = new OverlayContainer[] { chatOverlay, dashboard, beatmapListing, changelogOverlay, rankingsOverlay };
|
||||
var singleDisplayOverlays = new OverlayContainer[] { chatOverlay, news, dashboard, beatmapListing, changelogOverlay, rankingsOverlay };
|
||||
|
||||
foreach (var overlay in singleDisplayOverlays)
|
||||
{
|
||||
|
@ -69,6 +69,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
AutoSizeAxes = Axes.X,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ToolbarNewsButton(),
|
||||
new ToolbarChangelogButton(),
|
||||
new ToolbarRankingsButton(),
|
||||
new ToolbarBeatmapListingButton(),
|
||||
|
22
osu.Game/Overlays/Toolbar/ToolbarNewsButton.cs
Normal file
22
osu.Game/Overlays/Toolbar/ToolbarNewsButton.cs
Normal file
@ -0,0 +1,22 @@
|
||||
// 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.Graphics.Sprites;
|
||||
|
||||
namespace osu.Game.Overlays.Toolbar
|
||||
{
|
||||
public class ToolbarNewsButton : ToolbarOverlayToggleButton
|
||||
{
|
||||
public ToolbarNewsButton()
|
||||
{
|
||||
Icon = FontAwesome.Solid.Newspaper;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader(true)]
|
||||
private void load(NewsOverlay news)
|
||||
{
|
||||
StateContainer = news;
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user