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:
parent
fc2d9816df
commit
97db4856fc
@ -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,
|
||||||
|
@ -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
|
||||||
|
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\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" />
|
||||||
|
Loading…
Reference in New Issue
Block a user