Skip to content

Commit

Permalink
Fix selector dismissal behaviour during user actions
Browse files Browse the repository at this point in the history
  • Loading branch information
jai-x committed May 9, 2022
1 parent ebb64d1 commit 2481201
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion osu.Game/Overlays/ChatOverlayV2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,12 @@ protected override void LoadComplete()
};
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;
Expand Down Expand Up @@ -255,6 +260,10 @@ private void currentChannelChanged(ValueChangedEvent<Channel> channel)
// 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);

Expand Down

0 comments on commit 2481201

Please sign in to comment.