mirror of
https://github.com/osukey/osukey.git
synced 2025-06-24 04:38:02 +09: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(NotificationOverlay),
|
||||||
typeof(BeatmapListingOverlay),
|
typeof(BeatmapListingOverlay),
|
||||||
typeof(DashboardOverlay),
|
typeof(DashboardOverlay),
|
||||||
|
typeof(NewsOverlay),
|
||||||
typeof(ChannelManager),
|
typeof(ChannelManager),
|
||||||
typeof(ChatOverlay),
|
typeof(ChatOverlay),
|
||||||
typeof(SettingsOverlay),
|
typeof(SettingsOverlay),
|
||||||
|
@ -71,6 +71,8 @@ namespace osu.Game
|
|||||||
|
|
||||||
private DashboardOverlay dashboard;
|
private DashboardOverlay dashboard;
|
||||||
|
|
||||||
|
private NewsOverlay news;
|
||||||
|
|
||||||
private UserProfileOverlay userProfile;
|
private UserProfileOverlay userProfile;
|
||||||
|
|
||||||
private BeatmapSetOverlay beatmapSetOverlay;
|
private BeatmapSetOverlay beatmapSetOverlay;
|
||||||
@ -630,6 +632,7 @@ namespace osu.Game
|
|||||||
// overlay elements
|
// overlay elements
|
||||||
loadComponentSingleFile(beatmapListing = new BeatmapListingOverlay(), overlayContent.Add, true);
|
loadComponentSingleFile(beatmapListing = new BeatmapListingOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(dashboard = new DashboardOverlay(), 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);
|
var rankingsOverlay = loadComponentSingleFile(new RankingsOverlay(), overlayContent.Add, true);
|
||||||
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal, true);
|
loadComponentSingleFile(channelManager = new ChannelManager(), AddInternal, true);
|
||||||
loadComponentSingleFile(chatOverlay = new ChatOverlay(), overlayContent.Add, 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.
|
// 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)
|
foreach (var overlay in singleDisplayOverlays)
|
||||||
{
|
{
|
||||||
|
@ -69,6 +69,7 @@ namespace osu.Game.Overlays.Toolbar
|
|||||||
AutoSizeAxes = Axes.X,
|
AutoSizeAxes = Axes.X,
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
|
new ToolbarNewsButton(),
|
||||||
new ToolbarChangelogButton(),
|
new ToolbarChangelogButton(),
|
||||||
new ToolbarRankingsButton(),
|
new ToolbarRankingsButton(),
|
||||||
new ToolbarBeatmapListingButton(),
|
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…
x
Reference in New Issue
Block a user