From 2481201a734ef248e2f99f58734f136389b93393 Mon Sep 17 00:00:00 2001 From: Jai Sharma Date: Mon, 9 May 2022 22:58:46 +0100 Subject: [PATCH] Fix selector dismissal behaviour during user actions --- osu.Game/Overlays/ChatOverlayV2.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/osu.Game/Overlays/ChatOverlayV2.cs b/osu.Game/Overlays/ChatOverlayV2.cs index 48b34726f8..e59bee7977 100644 --- a/osu.Game/Overlays/ChatOverlayV2.cs +++ b/osu.Game/Overlays/ChatOverlayV2.cs @@ -165,7 +165,12 @@ namespace osu.Game.Overlays }; channelList.OnRequestLeave += channel => channelManager.LeaveChannel(channel); - channelListing.OnRequestJoin += channel => channelManager.JoinChannel(channel); + channelListing.OnRequestJoin += channel => + { + channelManager.JoinChannel(channel); + // Manually joining a channel should keep the selector open + selectorActive.Value = true; + }; channelListing.OnRequestLeave += channel => channelManager.LeaveChannel(channel); textBar.OnSearchTermsChanged += searchTerms => channelListing.SearchTerm = searchTerms; @@ -255,6 +260,10 @@ namespace osu.Game.Overlays // Channel is null when leaving the currently selected channel if (newChannel == null) { + // Don't need to autoswitch if the selector is visible + if (selectorActive.Value) + return; + // Find another channel to switch to newChannel = channelManager.JoinedChannels.FirstOrDefault(c => c != channel.OldValue);