From 6c5599f874f9c0959cc0280f433a70f095f4be33 Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Jun 2019 15:09:54 +0900 Subject: [PATCH 1/2] Fix chat being dismissed in test scene when it shouldn't --- .../Visual/Online/TestSceneChatDisplay.cs | 45 ------------------- osu.Game/Overlays/ChatOverlay.cs | 2 +- 2 files changed, 1 insertion(+), 46 deletions(-) delete mode 100644 osu.Game.Tests/Visual/Online/TestSceneChatDisplay.cs diff --git a/osu.Game.Tests/Visual/Online/TestSceneChatDisplay.cs b/osu.Game.Tests/Visual/Online/TestSceneChatDisplay.cs deleted file mode 100644 index 2789feef3d..0000000000 --- a/osu.Game.Tests/Visual/Online/TestSceneChatDisplay.cs +++ /dev/null @@ -1,45 +0,0 @@ -// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. -// See the LICENCE file in the repository root for full licence text. - -using System; -using System.Collections.Generic; -using System.ComponentModel; -using osu.Framework.Allocation; -using osu.Framework.Graphics; -using osu.Framework.Graphics.Containers; -using osu.Game.Online.Chat; -using osu.Game.Overlays; -using osu.Game.Overlays.Chat; -using osu.Game.Overlays.Chat.Tabs; - -namespace osu.Game.Tests.Visual.Online -{ - [Description("Testing chat api and overlay")] - public class TestSceneChatDisplay : OsuTestScene - { - public override IReadOnlyList RequiredTypes => new[] - { - typeof(ChatOverlay), - typeof(ChatLine), - typeof(DrawableChannel), - typeof(ChannelSelectorTabItem), - typeof(ChannelTabControl), - typeof(ChannelTabItem), - typeof(PrivateChannelTabItem), - typeof(TabCloseButton) - }; - - [Cached] - private readonly ChannelManager channelManager = new ChannelManager(); - - [BackgroundDependencyLoader] - private void load() - { - Children = new Drawable[] - { - channelManager, - new ChatOverlay { State = { Value = Visibility.Visible } } - }; - } - } -} diff --git a/osu.Game/Overlays/ChatOverlay.cs b/osu.Game/Overlays/ChatOverlay.cs index e6f2983488..fce9862e8e 100644 --- a/osu.Game/Overlays/ChatOverlay.cs +++ b/osu.Game/Overlays/ChatOverlay.cs @@ -171,7 +171,7 @@ namespace osu.Game.Overlays channelTabControl.ChannelSelectorActive.ValueChanged += active => channelSelectionOverlay.State.Value = active.NewValue ? Visibility.Visible : Visibility.Hidden; channelSelectionOverlay.State.ValueChanged += state => { - if (state.NewValue == Visibility.Hidden && channelManager.CurrentChannel.Value == null) + if (state.NewValue == Visibility.Hidden && channelManager.JoinedChannels.Count == 0) { channelSelectionOverlay.Show(); Hide(); From 19be83181f234057d7abdd44064391a834d8314d Mon Sep 17 00:00:00 2001 From: Dean Herbert Date: Fri, 21 Jun 2019 15:32:06 +0900 Subject: [PATCH 2/2] Add back missing test scene --- .../Visual/Online/TestSceneChatOverlay.cs | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs diff --git a/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs b/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs new file mode 100644 index 0000000000..c75348112f --- /dev/null +++ b/osu.Game.Tests/Visual/Online/TestSceneChatOverlay.cs @@ -0,0 +1,44 @@ +// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. +// See the LICENCE file in the repository root for full licence text. + +using System; +using System.Collections.Generic; +using System.ComponentModel; +using osu.Framework.Allocation; +using osu.Framework.Graphics; +using osu.Framework.Graphics.Containers; +using osu.Game.Online.Chat; +using osu.Game.Overlays; +using osu.Game.Overlays.Chat; +using osu.Game.Overlays.Chat.Tabs; + +namespace osu.Game.Tests.Visual.Online +{ + [Description("Testing chat api and overlay")] + public class TestSceneChatOverlay : OsuTestScene + { + public override IReadOnlyList RequiredTypes => new[] + { + typeof(ChatLine), + typeof(DrawableChannel), + typeof(ChannelSelectorTabItem), + typeof(ChannelTabControl), + typeof(ChannelTabItem), + typeof(PrivateChannelTabItem), + typeof(TabCloseButton) + }; + + [Cached] + private readonly ChannelManager channelManager = new ChannelManager(); + + [BackgroundDependencyLoader] + private void load() + { + Children = new Drawable[] + { + channelManager, + new ChatOverlay { State = { Value = Visibility.Visible } } + }; + } + } +}