mirror of
https://github.com/osukey/osukey.git
synced 2025-06-05 21:07:18 +09:00
Check against type instead of channel name
This commit is contained in:
parent
496a9dd41d
commit
d53fb9a5c8
@ -93,7 +93,7 @@ namespace osu.Game.Tests.Visual.Online
|
|||||||
AddUntilStep("remove all channels", () =>
|
AddUntilStep("remove all channels", () =>
|
||||||
{
|
{
|
||||||
var first = channelTabControl.Items.First();
|
var first = channelTabControl.Items.First();
|
||||||
if (first.Name == "+")
|
if (first is ChannelSelectorTabChannel)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
channelTabControl.RemoveChannel(first);
|
channelTabControl.RemoveChannel(first);
|
||||||
|
@ -10,6 +10,7 @@ using osu.Framework.Bindables;
|
|||||||
using osu.Framework.Logging;
|
using osu.Framework.Logging;
|
||||||
using osu.Game.Online.API;
|
using osu.Game.Online.API;
|
||||||
using osu.Game.Online.API.Requests;
|
using osu.Game.Online.API.Requests;
|
||||||
|
using osu.Game.Overlays.Chat.Tabs;
|
||||||
using osu.Game.Users;
|
using osu.Game.Users;
|
||||||
|
|
||||||
namespace osu.Game.Online.Chat
|
namespace osu.Game.Online.Chat
|
||||||
@ -86,7 +87,7 @@ namespace osu.Game.Online.Chat
|
|||||||
|
|
||||||
private void currentChannelChanged(ValueChangedEvent<Channel> e)
|
private void currentChannelChanged(ValueChangedEvent<Channel> e)
|
||||||
{
|
{
|
||||||
if (e.NewValue?.Name != "+")
|
if (!(e.NewValue is ChannelSelectorTabChannel))
|
||||||
JoinChannel(e.NewValue);
|
JoinChannel(e.NewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -199,10 +199,8 @@ namespace osu.Game.Overlays
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.NewValue.Name == "+")
|
if (e.NewValue is ChannelSelectorTabChannel)
|
||||||
{
|
|
||||||
return;
|
return;
|
||||||
}
|
|
||||||
|
|
||||||
textbox.Current.Disabled = e.NewValue.ReadOnly;
|
textbox.Current.Disabled = e.NewValue.ReadOnly;
|
||||||
|
|
||||||
@ -273,7 +271,7 @@ namespace osu.Game.Overlays
|
|||||||
private void selectTab(int index)
|
private void selectTab(int index)
|
||||||
{
|
{
|
||||||
var channel = channelTabControl.Items.Skip(index).FirstOrDefault();
|
var channel = channelTabControl.Items.Skip(index).FirstOrDefault();
|
||||||
if (channel != null && channel.Name != "+")
|
if (channel != null && !(channel is ChannelSelectorTabChannel))
|
||||||
channelTabControl.Current.Value = channel;
|
channelTabControl.Current.Value = channel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user