Add ability to close chat tabs.

This commit is contained in:
naoey
2017-08-03 20:55:52 +05:30
parent 384b8c0600
commit 2ae3ce8b91
2 changed files with 53 additions and 4 deletions

View File

@ -160,6 +160,7 @@ namespace osu.Game.Overlays
channelTabs = new ChatTabControl
{
RelativeSizeAxes = Axes.Both,
OnRequestLeave = removeChannel,
},
}
},
@ -305,6 +306,7 @@ namespace osu.Game.Overlays
addChannel(channels.Find(c => c.Name == @"#lobby"));
channelSelection.OnRequestJoin = addChannel;
channelSelection.OnRequestLeave = removeChannel;
channelSelection.Sections = new[]
{
new ChannelSection
@ -391,6 +393,16 @@ namespace osu.Game.Overlays
channel.Joined.Value = true;
}
private void removeChannel(Channel channel)
{
if (channel == null) return;
careChannels.Remove(channel);
channelTabs.RemoveItem(channel);
channel.Joined.Value = false;
}
private void fetchInitialMessages(Channel channel)
{
var req = new GetMessagesRequest(new List<Channel> { channel }, null);