Use CMC for all of multiplayer

This commit is contained in:
smoogipoo
2019-02-05 19:00:01 +09:00
parent be51ee4ed5
commit aac371ba6e
38 changed files with 652 additions and 768 deletions

View File

@ -1,10 +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 Humanizer;
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Game.Graphics;
@ -16,26 +14,24 @@ using osuTK;
namespace osu.Game.Screens.Multi.Lounge.Components
{
public class ParticipantInfo : Container
public class ParticipantInfo : MultiplayerComposite
{
private readonly FillFlowContainer summaryContainer;
public readonly IBindable<User> Host = new Bindable<User>();
public readonly IBindable<IEnumerable<User>> Participants = new Bindable<IEnumerable<User>>();
public readonly IBindable<int> ParticipantCount = new Bindable<int>();
public ParticipantInfo()
{
OsuSpriteText summary;
RelativeSizeAxes = Axes.X;
Height = 15f;
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
OsuSpriteText summary;
OsuSpriteText levelRangeHigher;
OsuSpriteText levelRangeLower;
Container flagContainer;
LinkFlowContainer hostText;
Children = new Drawable[]
InternalChildren = new Drawable[]
{
new FillFlowContainer
{
@ -73,12 +69,13 @@ namespace osu.Game.Screens.Multi.Lounge.Components
}
},
},
summaryContainer = new FillFlowContainer
new FillFlowContainer
{
Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal,
Colour = colours.Gray9,
Children = new[]
{
summary = new OsuSpriteText
@ -101,9 +98,9 @@ namespace osu.Game.Screens.Multi.Lounge.Components
hostText.AddLink(v.Username, null, LinkAction.OpenUserProfile, v.Id.ToString(), "Open profile", s => s.Font = "Exo2.0-BoldItalic");
flagContainer.Child = new DrawableFlag(v.Country) { RelativeSizeAxes = Axes.Both };
}
});
}, true);
ParticipantCount.BindValueChanged(v => summary.Text = $"{v:#,0}{" participant".Pluralize(v == 1)}");
ParticipantCount.BindValueChanged(v => summary.Text = $"{v:#,0}{" participant".Pluralize(v == 1)}", true);
/*Participants.BindValueChanged(v =>
{
@ -112,11 +109,5 @@ namespace osu.Game.Screens.Multi.Lounge.Components
levelRangeHigher.Text = ranks.Max().ToString();
});*/
}
[BackgroundDependencyLoader]
private void load(OsuColour colours)
{
summaryContainer.Colour = colours.Gray9;
}
}
}