Make room participants into a bindable list

This commit is contained in:
smoogipoo
2020-02-13 18:59:15 +09:00
parent 08d0a08d54
commit bce9c8f3f3
5 changed files with 28 additions and 20 deletions

View File

@ -51,9 +51,9 @@ namespace osu.Game.Screens.Multi.Match.Components
},
};
Participants.BindValueChanged(participants =>
Participants.ItemsAdded += users =>
{
usersFlow.Children = participants.NewValue.Select(u =>
usersFlow.AddRange(users.Select(u =>
{
var panel = new UserPanel(u)
{
@ -65,8 +65,13 @@ namespace osu.Game.Screens.Multi.Match.Components
panel.OnLoadComplete += d => d.FadeInFromZero(60);
return panel;
}).ToList();
}, true);
}).ToList());
};
Participants.ItemsRemoved += users =>
{
usersFlow.RemoveAll(p => users.Contains(p.User));
};
}
}
}