1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-22 03:27:24 +08:00

Add toolbar toggle button

Also ensure chat is hidden when social is displayed and vice-versa.
This commit is contained in:
Dean Herbert 2017-06-07 20:15:58 +09:00
parent fc2d9816df
commit 97db4856fc
4 changed files with 29 additions and 0 deletions

View File

@ -201,11 +201,16 @@ namespace osu.Game
}; };
Dependencies.Cache(settings); Dependencies.Cache(settings);
Dependencies.Cache(social);
Dependencies.Cache(chat); Dependencies.Cache(chat);
Dependencies.Cache(musicController); Dependencies.Cache(musicController);
Dependencies.Cache(notificationManager); Dependencies.Cache(notificationManager);
Dependencies.Cache(dialogOverlay); Dependencies.Cache(dialogOverlay);
// ensure both overlays aren't presented at the same time
chat.StateChanged += (container, state) => social.State = state == Visibility.Visible ? Visibility.Hidden : social.State;
social.StateChanged += (container, state) => chat.State = state == Visibility.Visible ? Visibility.Hidden : chat.State;
LoadComponentAsync(Toolbar = new Toolbar LoadComponentAsync(Toolbar = new Toolbar
{ {
Depth = -3, Depth = -3,

View File

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

View File

@ -0,0 +1,22 @@
// Copyright (c) 2007-2017 ppy Pty Ltd <contact@ppy.sh>.
// Licensed under the MIT Licence - https://raw.githubusercontent.com/ppy/osu/master/LICENCE
using osu.Framework.Allocation;
using osu.Game.Graphics;
namespace osu.Game.Overlays.Toolbar
{
internal class ToolbarSocialButton : ToolbarOverlayToggleButton
{
public ToolbarSocialButton()
{
Icon = FontAwesome.fa_users;
}
[BackgroundDependencyLoader]
private void load(SocialOverlay chat)
{
StateContainer = chat;
}
}
}

View File

@ -89,6 +89,7 @@
<Compile Include="Overlays\Settings\SettingsHeader.cs" /> <Compile Include="Overlays\Settings\SettingsHeader.cs" />
<Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" /> <Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" />
<Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" /> <Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" />
<Compile Include="Overlays\Toolbar\ToolbarSocialButton.cs" />
<Compile Include="Rulesets\Beatmaps\BeatmapConverter.cs" /> <Compile Include="Rulesets\Beatmaps\BeatmapConverter.cs" />
<Compile Include="Rulesets\Beatmaps\BeatmapProcessor.cs" /> <Compile Include="Rulesets\Beatmaps\BeatmapProcessor.cs" />
<Compile Include="Beatmaps\ControlPoints\ControlPoint.cs" /> <Compile Include="Beatmaps\ControlPoints\ControlPoint.cs" />