diff --git a/osu.Game/Overlays/ChatOverlayV2.cs b/osu.Game/Overlays/ChatOverlayV2.cs index 19609f0702..60b25ef52d 100644 --- a/osu.Game/Overlays/ChatOverlayV2.cs +++ b/osu.Game/Overlays/ChatOverlayV2.cs @@ -50,8 +50,6 @@ namespace osu.Game.Overlays private const float side_bar_width = 190; private const float chat_bar_height = 60; - private readonly BindableBool selectorActive = new BindableBool(); - [Resolved] private OsuConfigManager config { get; set; } = null!; @@ -136,7 +134,6 @@ namespace osu.Game.Overlays Anchor = Anchor.BottomRight, Origin = Anchor.BottomRight, Padding = new MarginPadding { Left = side_bar_width }, - ShowSearch = { BindTarget = selectorActive }, }, }; } @@ -145,8 +142,6 @@ namespace osu.Game.Overlays { base.LoadComplete(); - loading.Show(); - config.BindWith(OsuSetting.ChatDisplayHeight, chatHeight); chatHeight.BindValueChanged(height => { Height = height.NewValue; }, true); @@ -164,8 +159,6 @@ namespace osu.Game.Overlays textBar.OnSearchTermsChanged += searchTerms => channelListing.SearchTerm = searchTerms; textBar.OnChatMessageCommitted += handleChatMessage; - - selectorActive.BindValueChanged(v => channelListing.State.Value = v.NewValue ? Visibility.Visible : Visibility.Hidden, true); } /// @@ -244,22 +237,25 @@ namespace osu.Game.Overlays { Channel? newChannel = channel.NewValue; - loading.Show(); - if (newChannel == null) { - selectorActive.Value = true; - return; + // null channel denotes that we should be showing the listing. + channelListing.State.Value = Visibility.Visible; + textBar.ShowSearch.Value = true; } - - selectorActive.Value = false; - - LoadComponentAsync(new DrawableChannel(newChannel), loaded => + else { - currentChannelContainer.Clear(); - currentChannelContainer.Add(loaded); - loading.Hide(); - }); + channelListing.State.Value = Visibility.Hidden; + textBar.ShowSearch.Value = false; + + loading.Show(); + LoadComponentAsync(new DrawableChannel(newChannel), loaded => + { + currentChannelContainer.Clear(); + currentChannelContainer.Add(loaded); + loading.Hide(); + }); + } } private void joinedChannelsChanged(object sender, NotifyCollectionChangedEventArgs args)