Add toolbar button

This commit is contained in:
Dean Herbert 2019-05-13 17:01:17 +09:00
parent e9c3f54307
commit 50c440de8d
3 changed files with 27 additions and 0 deletions

View File

@ -76,6 +76,8 @@ namespace osu.Game
private BeatmapSetOverlay beatmapSetOverlay;
private ChangelogOverlay changelogOverlay;
[Cached]
private readonly ScreenshotManager screenshotManager = new ScreenshotManager();
@ -448,6 +450,7 @@ namespace osu.Game
loadComponentSingleFile(settings = new MainSettings { GetToolbarHeight = () => ToolbarOffset }, leftFloatingOverlayContent.Add);
loadComponentSingleFile(userProfile = new UserProfileOverlay(), overlayContent.Add);
loadComponentSingleFile(beatmapSetOverlay = new BeatmapSetOverlay(), overlayContent.Add);
loadComponentSingleFile(changelogOverlay = new ChangelogOverlay(), overlayContent.Add);
loadComponentSingleFile(loginOverlay = new LoginOverlay
{
@ -480,6 +483,7 @@ namespace osu.Game
dependencies.Cache(notifications);
dependencies.Cache(loginOverlay);
dependencies.Cache(dialogOverlay);
dependencies.Cache(changelogOverlay);
dependencies.Cache(accountCreation);
chatOverlay.StateChanged += state => channelManager.HighPollRate.Value = state == Visibility.Visible;

View File

@ -69,6 +69,7 @@ namespace osu.Game.Overlays.Toolbar
AutoSizeAxes = Axes.X,
Children = new Drawable[]
{
new ToolbarChangelogButton(),
new ToolbarDirectButton(),
new ToolbarChatButton(),
new ToolbarSocialButton(),

View 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 ToolbarChangelogButton : ToolbarOverlayToggleButton
{
public ToolbarChangelogButton()
{
SetIcon(FontAwesome.Solid.Bullhorn);
}
[BackgroundDependencyLoader(true)]
private void load(ChangelogOverlay changelog)
{
StateContainer = changelog;
}
}
}