mirror of
https://github.com/ppy/osu.git
synced 2024-12-14 13:22:55 +08:00
Rename dummy channel and move to a nested class inside the ChannelListing
itself
This commit is contained in:
parent
63c9776365
commit
136ecb45e2
@ -13,6 +13,7 @@ using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Chat.ChannelList;
|
||||
using osu.Game.Overlays.Chat.Listing;
|
||||
|
||||
namespace osu.Game.Tests.Visual.Online
|
||||
{
|
||||
@ -147,7 +148,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
});
|
||||
}
|
||||
|
||||
private bool validItem => selected.Value != null && !(selected.Value is DummySelectorChannel);
|
||||
private bool validItem => selected.Value != null && !(selected.Value is ChannelListing.ChannelListingChannel);
|
||||
|
||||
private Channel createRandomPublicChannel()
|
||||
{
|
||||
|
@ -408,7 +408,7 @@ namespace osu.Game.Tests.Visual.Online
|
||||
chatOverlay.ChildrenOfType<ChatOverlayTopBar>().Single();
|
||||
|
||||
private ChannelListItem channelSelectorButton =>
|
||||
chatOverlay.ChildrenOfType<ChannelListItem>().Single(item => item.Channel is DummySelectorChannel);
|
||||
chatOverlay.ChildrenOfType<ChannelListItem>().Single(item => item.Channel is ChannelListing.ChannelListingChannel);
|
||||
|
||||
private void clickDrawable(Drawable d)
|
||||
{
|
||||
|
@ -14,7 +14,7 @@ using osu.Game.Input;
|
||||
using osu.Game.Online.API;
|
||||
using osu.Game.Online.API.Requests;
|
||||
using osu.Game.Online.API.Requests.Responses;
|
||||
using osu.Game.Overlays;
|
||||
using osu.Game.Overlays.Chat.Listing;
|
||||
using osu.Game.Overlays.Chat.Tabs;
|
||||
|
||||
namespace osu.Game.Online.Chat
|
||||
@ -134,7 +134,7 @@ namespace osu.Game.Online.Chat
|
||||
|
||||
private void currentChannelChanged(ValueChangedEvent<Channel> e)
|
||||
{
|
||||
bool isSelectorChannel = e.NewValue is ChannelSelectorTabItem.ChannelSelectorTabChannel || e.NewValue is DummySelectorChannel;
|
||||
bool isSelectorChannel = e.NewValue is ChannelSelectorTabItem.ChannelSelectorTabChannel || e.NewValue is ChannelListing.ChannelListingChannel;
|
||||
|
||||
if (!isSelectorChannel)
|
||||
JoinChannel(e.NewValue);
|
||||
|
@ -13,6 +13,7 @@ using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays.Chat.Listing;
|
||||
|
||||
namespace osu.Game.Overlays.Chat.ChannelList
|
||||
{
|
||||
@ -23,7 +24,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
|
||||
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
|
||||
|
||||
private readonly DummySelectorChannel dummySelectorChannel = new DummySelectorChannel();
|
||||
private readonly ChannelListing.ChannelListingChannel channelListingChannel = new ChannelListing.ChannelListingChannel();
|
||||
|
||||
private ChannelListItemFlow publicChannelFlow = null!;
|
||||
private ChannelListItemFlow privateChannelFlow = null!;
|
||||
@ -53,7 +54,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
Children = new Drawable[]
|
||||
{
|
||||
publicChannelFlow = new ChannelListItemFlow("CHANNELS"),
|
||||
selector = new ChannelListItem(dummySelectorChannel)
|
||||
selector = new ChannelListItem(channelListingChannel)
|
||||
{
|
||||
Margin = new MarginPadding { Bottom = 10 },
|
||||
},
|
||||
|
@ -15,6 +15,7 @@ using osu.Game.Graphics;
|
||||
using osu.Game.Graphics.Containers;
|
||||
using osu.Game.Graphics.Sprites;
|
||||
using osu.Game.Online.Chat;
|
||||
using osu.Game.Overlays.Chat.Listing;
|
||||
using osu.Game.Users.Drawables;
|
||||
using osuTK;
|
||||
|
||||
@ -191,6 +192,6 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
||||
text.FadeColour(colourProvider.Light3, 200, Easing.OutQuint);
|
||||
}
|
||||
|
||||
private bool isSelector => Channel is DummySelectorChannel;
|
||||
private bool isSelector => Channel is ChannelListing.ChannelListingChannel;
|
||||
}
|
||||
}
|
||||
|
@ -75,5 +75,14 @@ namespace osu.Game.Overlays.Chat.Listing
|
||||
protected override void PopIn() => this.FadeIn();
|
||||
|
||||
protected override void PopOut() => this.FadeOut();
|
||||
|
||||
public class ChannelListingChannel : Channel
|
||||
{
|
||||
public ChannelListingChannel()
|
||||
{
|
||||
Name = "Add more channels";
|
||||
Type = ChannelType.System;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -244,7 +244,7 @@ namespace osu.Game.Overlays
|
||||
{
|
||||
Channel? newChannel = channel.NewValue;
|
||||
|
||||
if (newChannel == null || newChannel is DummySelectorChannel)
|
||||
if (newChannel == null || newChannel is ChannelListing.ChannelListingChannel)
|
||||
{
|
||||
// null channel denotes that we should be showing the listing.
|
||||
channelListing.State.Value = Visibility.Visible;
|
||||
@ -300,13 +300,4 @@ namespace osu.Game.Overlays
|
||||
channelManager.PostMessage(message);
|
||||
}
|
||||
}
|
||||
|
||||
public class DummySelectorChannel : Channel
|
||||
{
|
||||
public DummySelectorChannel()
|
||||
{
|
||||
Name = "Add more channels";
|
||||
Type = ChannelType.System;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user