mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 16:59:53 +09:00
Add ability to close chat tabs.
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user