mirror of
https://github.com/osukey/osukey.git
synced 2025-07-01 16:29:58 +09:00
Rename the currentChatChanged to currentChannelContainer, move drawing specific part into from chatoverlay to ChannelSelectionOverlay
This commit is contained in:
@ -35,23 +35,6 @@ namespace osu.Game.Overlays.Chat.Selection
|
||||
public Action<Channel> OnRequestJoin;
|
||||
public Action<Channel> OnRequestLeave;
|
||||
|
||||
public IEnumerable<ChannelSection> Sections
|
||||
{
|
||||
set
|
||||
{
|
||||
sectionsFlow.ChildrenEnumerable = value;
|
||||
|
||||
foreach (ChannelSection s in sectionsFlow.Children)
|
||||
{
|
||||
foreach (ChannelListItem c in s.ChannelFlow.Children)
|
||||
{
|
||||
c.OnRequestJoin = channel => { OnRequestJoin?.Invoke(channel); };
|
||||
c.OnRequestLeave = channel => { OnRequestLeave?.Invoke(channel); };
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ChannelSelectionOverlay()
|
||||
{
|
||||
RelativeSizeAxes = Axes.X;
|
||||
@ -140,6 +123,27 @@ namespace osu.Game.Overlays.Chat.Selection
|
||||
search.Current.ValueChanged += newValue => sectionsFlow.SearchTerm = newValue;
|
||||
}
|
||||
|
||||
public void UpdateAvailableChannels(IEnumerable<Channel> channels)
|
||||
{
|
||||
sectionsFlow.ChildrenEnumerable = new[]
|
||||
{
|
||||
new ChannelSection
|
||||
{
|
||||
Header = "All Channels",
|
||||
Channels = channels,
|
||||
},
|
||||
};
|
||||
|
||||
foreach (ChannelSection s in sectionsFlow.Children)
|
||||
{
|
||||
foreach (ChannelListItem c in s.ChannelFlow.Children)
|
||||
{
|
||||
c.OnRequestJoin = channel => { OnRequestJoin?.Invoke(channel); };
|
||||
c.OnRequestLeave = channel => { OnRequestLeave?.Invoke(channel); };
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load(OsuColour colours)
|
||||
{
|
||||
|
Reference in New Issue
Block a user