mirror of
https://github.com/ppy/osu.git
synced 2025-01-15 06:42:56 +08:00
Finding peace with the UI thread.
There is the issue that in some cases that the ui thread blocked.
This commit is contained in:
parent
16db81e9b5
commit
55f0cbf63e
@ -48,8 +48,10 @@ namespace osu.Game.Overlays.Chat
|
||||
}
|
||||
|
||||
public void AddItem(Channel channel)
|
||||
{
|
||||
ChannelTabControl.AddItem(channel);
|
||||
{
|
||||
if (!ChannelTabControl.Items.Contains(channel))
|
||||
ChannelTabControl.AddItem(channel);
|
||||
|
||||
if (Current.Value == null)
|
||||
Current.Value = channel;
|
||||
}
|
||||
|
@ -55,15 +55,11 @@ namespace osu.Game.Overlays.Chat
|
||||
Channel.PendingMessageResolved += pendingMessageResolved;
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
newMessagesArrived(Channel.Messages);
|
||||
}
|
||||
|
||||
protected override void LoadComplete()
|
||||
{
|
||||
base.LoadComplete();
|
||||
|
||||
newMessagesArrived(Channel.Messages);
|
||||
scrollToEnd();
|
||||
}
|
||||
|
||||
|
@ -125,23 +125,26 @@ namespace osu.Game.Overlays.Chat.Selection
|
||||
|
||||
public void UpdateAvailableChannels(IEnumerable<Channel> channels)
|
||||
{
|
||||
sectionsFlow.ChildrenEnumerable = new[]
|
||||
Scheduler.Add(() =>
|
||||
{
|
||||
new ChannelSection
|
||||
sectionsFlow.ChildrenEnumerable = new[]
|
||||
{
|
||||
Header = "All Channels",
|
||||
Channels = channels,
|
||||
},
|
||||
};
|
||||
new ChannelSection
|
||||
{
|
||||
Header = "All Channels",
|
||||
Channels = channels,
|
||||
},
|
||||
};
|
||||
|
||||
foreach (ChannelSection s in sectionsFlow.Children)
|
||||
{
|
||||
foreach (ChannelListItem c in s.ChannelFlow.Children)
|
||||
foreach (ChannelSection s in sectionsFlow.Children)
|
||||
{
|
||||
c.OnRequestJoin = channel => { OnRequestJoin?.Invoke(channel); };
|
||||
c.OnRequestLeave = channel => { OnRequestLeave?.Invoke(channel); };
|
||||
foreach (ChannelListItem c in s.ChannelFlow.Children)
|
||||
{
|
||||
c.OnRequestJoin = channel => { OnRequestJoin?.Invoke(channel); };
|
||||
c.OnRequestLeave = channel => { OnRequestLeave?.Invoke(channel); };
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
|
Loading…
Reference in New Issue
Block a user