mirror of
https://github.com/osukey/osukey.git
synced 2025-08-01 21:58:46 +09:00
Use CMC for all of multiplayer
This commit is contained in:
@ -1,9 +1,8 @@
|
||||
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
||||
// See the LICENCE file in the repository root for full licence text.
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using osu.Framework.Configuration;
|
||||
using osu.Framework.Allocation;
|
||||
using osu.Framework.Graphics;
|
||||
using osu.Framework.Graphics.Containers;
|
||||
using osu.Game.Overlays.SearchableList;
|
||||
@ -13,16 +12,12 @@ using osuTK;
|
||||
|
||||
namespace osu.Game.Screens.Multi.Match.Components
|
||||
{
|
||||
public class Participants : CompositeDrawable
|
||||
public class Participants : MultiplayerComposite
|
||||
{
|
||||
public readonly IBindable<IEnumerable<User>> Users = new Bindable<IEnumerable<User>>();
|
||||
public readonly IBindable<int> ParticipantCount = new Bindable<int>();
|
||||
public readonly IBindable<int?> MaxParticipants = new Bindable<int?>();
|
||||
|
||||
public Participants()
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
FillFlowContainer<UserPanel> usersFlow;
|
||||
ParticipantCountDisplay count;
|
||||
|
||||
InternalChild = new Container
|
||||
{
|
||||
@ -36,7 +31,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
Padding = new MarginPadding { Top = 10 },
|
||||
Children = new Drawable[]
|
||||
{
|
||||
count = new ParticipantCountDisplay
|
||||
new ParticipantCountDisplay
|
||||
{
|
||||
Anchor = Anchor.TopRight,
|
||||
Origin = Anchor.TopRight,
|
||||
@ -55,11 +50,7 @@ namespace osu.Game.Screens.Multi.Match.Components
|
||||
},
|
||||
};
|
||||
|
||||
count.Participants.BindTo(Users);
|
||||
count.ParticipantCount.BindTo(ParticipantCount);
|
||||
count.MaxParticipants.BindTo(MaxParticipants);
|
||||
|
||||
Users.BindValueChanged(v =>
|
||||
Participants.BindValueChanged(v =>
|
||||
{
|
||||
usersFlow.Children = v.Select(u => new UserPanel(u)
|
||||
{
|
||||
|
Reference in New Issue
Block a user