mirror of
https://github.com/ppy/osu
synced 2025-01-03 12:52:10 +00:00
Add toolbar toggle button
Also ensure chat is hidden when social is displayed and vice-versa.
This commit is contained in:
parent
fc2d9816df
commit
97db4856fc
@ -201,11 +201,16 @@ namespace osu.Game
|
||||
};
|
||||
|
||||
Dependencies.Cache(settings);
|
||||
Dependencies.Cache(social);
|
||||
Dependencies.Cache(chat);
|
||||
Dependencies.Cache(musicController);
|
||||
Dependencies.Cache(notificationManager);
|
||||
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
|
||||
{
|
||||
Depth = -3,
|
||||
|
@ -63,6 +63,7 @@ namespace osu.Game.Overlays.Toolbar
|
||||
AutoSizeAxes = Axes.X,
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new ToolbarSocialButton(),
|
||||
new ToolbarChatButton(),
|
||||
new ToolbarMusicButton(),
|
||||
new ToolbarButton
|
||||
|
22
osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs
Normal file
22
osu.Game/Overlays/Toolbar/ToolbarSocialButton.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
}
|
@ -89,6 +89,7 @@
|
||||
<Compile Include="Overlays\Settings\SettingsHeader.cs" />
|
||||
<Compile Include="Overlays\Settings\Sections\Audio\MainMenuSettings.cs" />
|
||||
<Compile Include="Overlays\Toolbar\ToolbarChatButton.cs" />
|
||||
<Compile Include="Overlays\Toolbar\ToolbarSocialButton.cs" />
|
||||
<Compile Include="Rulesets\Beatmaps\BeatmapConverter.cs" />
|
||||
<Compile Include="Rulesets\Beatmaps\BeatmapProcessor.cs" />
|
||||
<Compile Include="Beatmaps\ControlPoints\ControlPoint.cs" />
|
||||
|
Loading…
Reference in New Issue
Block a user