Use CurrentChannel == null to show the channel selector

This commit is contained in:
Jai Sharma
2022-05-11 22:52:15 +01:00
parent cced8609f6
commit db371ab068
4 changed files with 12 additions and 42 deletions

View File

@ -6,7 +6,6 @@
using System;
using System.Collections.Generic;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes;
@ -19,11 +18,9 @@ namespace osu.Game.Overlays.Chat.ChannelList
{
public class ChannelList : Container
{
public Action<Channel>? OnRequestSelect;
public Action<Channel?>? OnRequestSelect;
public Action<Channel>? OnRequestLeave;
public readonly BindableBool SelectorActive = new BindableBool();
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
private ChannelListItemFlow publicChannelFlow = null!;
@ -56,7 +53,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
new ChannelListSelector
{
Margin = new MarginPadding { Bottom = 10 },
SelectorActive = { BindTarget = SelectorActive },
Action = () => OnRequestSelect?.Invoke(null),
},
privateChannelFlow = new ChannelListItemFlow("DIRECT MESSAGES"),
},
@ -73,7 +70,6 @@ namespace osu.Game.Overlays.Chat.ChannelList
ChannelListItem item = new ChannelListItem(channel);
item.OnRequestSelect += chan => OnRequestSelect?.Invoke(chan);
item.OnRequestLeave += chan => OnRequestLeave?.Invoke(chan);
item.SelectorActive.BindTarget = SelectorActive;
ChannelListItemFlow flow = getFlowForChannel(channel);
channelMap.Add(channel, item);