mirror of
https://github.com/ppy/osu.git
synced 2025-03-11 02:17:19 +08:00
Only show team channel section when there is a team channel
This commit is contained in:
parent
4ac4b308e1
commit
e8f7bcb6e6
@ -115,11 +115,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
channelList.AddChannel(createRandomPrivateChannel());
|
||||
});
|
||||
|
||||
AddStep("Add Team Channels", () =>
|
||||
{
|
||||
for (int i = 0; i < 10; i++)
|
||||
channelList.AddChannel(createRandomTeamChannel());
|
||||
});
|
||||
AddStep("Add Team Channel", () => channelList.AddChannel(createRandomTeamChannel()));
|
||||
|
||||
AddStep("Add Announce Channels", () =>
|
||||
{
|
||||
|
@ -106,6 +106,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
};
|
||||
|
||||
selector.OnRequestSelect += chan => OnRequestSelect?.Invoke(chan);
|
||||
updateVisibility();
|
||||
}
|
||||
|
||||
public void AddChannel(Channel channel)
|
||||
@ -170,10 +171,8 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
|
||||
private void updateVisibility()
|
||||
{
|
||||
if (AnnounceChannelGroup.ItemFlow.Children.Count == 0)
|
||||
AnnounceChannelGroup.Hide();
|
||||
else
|
||||
AnnounceChannelGroup.Show();
|
||||
AnnounceChannelGroup.Alpha = AnnounceChannelGroup.ItemFlow.Any() ? 1 : 0;
|
||||
TeamChannelGroup.Alpha = TeamChannelGroup.ItemFlow.Any() ? 1 : 0;
|
||||
}
|
||||
|
||||
public partial class ChannelGroup : FillFlowContainer
|
||||
|
Loading…
x
Reference in New Issue
Block a user