mirror of
https://github.com/osukey/osukey.git
synced 2025-07-02 00:40:09 +09:00
Remove chatTabControl and transfer the logic into ChannelTabControl.
This commit is contained in:
@ -9,6 +9,7 @@ using osu.Game.Online.Chat;
|
||||
using OpenTK;
|
||||
using osu.Framework.Configuration;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace osu.Game.Overlays.Chat.Tabs
|
||||
{
|
||||
@ -64,6 +65,33 @@ namespace osu.Game.Overlays.Chat.Tabs
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds a channel to the ChannelTabControl.
|
||||
/// The first channel added will automaticly selected.
|
||||
/// </summary>
|
||||
/// <param name="channel">The channel that is going to be added.</param>
|
||||
public void AddChannel(Channel channel)
|
||||
{
|
||||
if (!Items.Contains(channel))
|
||||
AddItem(channel);
|
||||
|
||||
if (Current.Value == null)
|
||||
Current.Value = channel;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Removes a channel from the ChannelTabControl.
|
||||
/// If the selected channel is the one that is beeing removed, the next available channel will be selected.
|
||||
/// </summary>
|
||||
/// <param name="channel">The channel that is going to be removed.</param>
|
||||
public void RemoveChannel(Channel channel)
|
||||
{
|
||||
RemoveItem(channel);
|
||||
|
||||
if (Current.Value == channel)
|
||||
Current.Value = Items.FirstOrDefault();
|
||||
}
|
||||
|
||||
protected override void SelectTab(TabItem<Channel> tab)
|
||||
{
|
||||
if (tab is ChannelSelectorTabItem)
|
||||
|
Reference in New Issue
Block a user