mirror of
https://github.com/osukey/osukey.git
synced 2025-05-06 14:17:27 +09:00
Ensure current channel is set to the ChannelListingChannel
when it becomes null
This commit is contained in:
parent
136ecb45e2
commit
c37d1e4fae
@ -22,9 +22,9 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
|||||||
public Action<Channel>? OnRequestSelect;
|
public Action<Channel>? OnRequestSelect;
|
||||||
public Action<Channel>? OnRequestLeave;
|
public Action<Channel>? OnRequestLeave;
|
||||||
|
|
||||||
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
|
public readonly ChannelListing.ChannelListingChannel ChannelListingChannel = new ChannelListing.ChannelListingChannel();
|
||||||
|
|
||||||
private readonly ChannelListing.ChannelListingChannel channelListingChannel = new ChannelListing.ChannelListingChannel();
|
private readonly Dictionary<Channel, ChannelListItem> channelMap = new Dictionary<Channel, ChannelListItem>();
|
||||||
|
|
||||||
private ChannelListItemFlow publicChannelFlow = null!;
|
private ChannelListItemFlow publicChannelFlow = null!;
|
||||||
private ChannelListItemFlow privateChannelFlow = null!;
|
private ChannelListItemFlow privateChannelFlow = null!;
|
||||||
@ -54,7 +54,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
|||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
publicChannelFlow = new ChannelListItemFlow("CHANNELS"),
|
publicChannelFlow = new ChannelListItemFlow("CHANNELS"),
|
||||||
selector = new ChannelListItem(channelListingChannel)
|
selector = new ChannelListItem(ChannelListingChannel)
|
||||||
{
|
{
|
||||||
Margin = new MarginPadding { Bottom = 10 },
|
Margin = new MarginPadding { Bottom = 10 },
|
||||||
},
|
},
|
||||||
|
@ -179,7 +179,7 @@ namespace osu.Game.Overlays.Chat.ChannelList
|
|||||||
|
|
||||||
private void updateState()
|
private void updateState()
|
||||||
{
|
{
|
||||||
bool selected = selectedChannel.Value == Channel || (isSelector && selectedChannel.Value == null);
|
bool selected = selectedChannel.Value == Channel;
|
||||||
|
|
||||||
if (selected)
|
if (selected)
|
||||||
selectBox.FadeIn(300, Easing.OutQuint);
|
selectBox.FadeIn(300, Easing.OutQuint);
|
||||||
|
@ -244,9 +244,15 @@ namespace osu.Game.Overlays
|
|||||||
{
|
{
|
||||||
Channel? newChannel = channel.NewValue;
|
Channel? newChannel = channel.NewValue;
|
||||||
|
|
||||||
if (newChannel == null || newChannel is ChannelListing.ChannelListingChannel)
|
// null channel denotes that we should be showing the listing.
|
||||||
|
if (newChannel == null)
|
||||||
|
{
|
||||||
|
currentChannel.Value = channelList.ChannelListingChannel;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (newChannel is ChannelListing.ChannelListingChannel)
|
||||||
{
|
{
|
||||||
// null channel denotes that we should be showing the listing.
|
|
||||||
channelListing.State.Value = Visibility.Visible;
|
channelListing.State.Value = Visibility.Visible;
|
||||||
textBar.ShowSearch.Value = true;
|
textBar.ShowSearch.Value = true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user