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

@ -2,11 +2,8 @@
// See the LICENCE file in the repository root for full licence text.
using osu.Framework.Allocation;
using osu.Framework.Configuration;
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
using osu.Framework.Localisation;
using osu.Game.Beatmaps;
using osu.Game.Graphics;
using osu.Game.Graphics.Containers;
using osu.Game.Graphics.Sprites;
@ -14,10 +11,8 @@ using osu.Game.Online.Chat;
namespace osu.Game.Screens.Multi.Components
{
public class BeatmapTitle : CompositeDrawable
public class BeatmapTitle : MultiplayerComposite
{
public readonly IBindable<BeatmapInfo> Beatmap = new Bindable<BeatmapInfo>();
private readonly LinkFlowContainer textFlow;
public BeatmapTitle()
@ -27,10 +22,10 @@ namespace osu.Game.Screens.Multi.Components
InternalChild = textFlow = new LinkFlowContainer { AutoSizeAxes = Axes.Both };
}
protected override void LoadComplete()
[BackgroundDependencyLoader]
private void load()
{
base.LoadComplete();
Beatmap.BindValueChanged(v => updateText(), true);
CurrentBeatmap.BindValueChanged(v => updateText(), true);
}
private float textSize = OsuSpriteText.FONT_SIZE;
@ -58,7 +53,7 @@ namespace osu.Game.Screens.Multi.Components
textFlow.Clear();
if (Beatmap.Value == null)
if (CurrentBeatmap.Value == null)
textFlow.AddText("No beatmap selected", s =>
{
s.TextSize = TextSize;
@ -70,7 +65,7 @@ namespace osu.Game.Screens.Multi.Components
{
new OsuSpriteText
{
Text = new LocalisedString((Beatmap.Value.Metadata.ArtistUnicode, Beatmap.Value.Metadata.Artist)),
Text = new LocalisedString((CurrentBeatmap.Value.Metadata.ArtistUnicode, CurrentBeatmap.Value.Metadata.Artist)),
TextSize = TextSize,
},
new OsuSpriteText
@ -80,10 +75,10 @@ namespace osu.Game.Screens.Multi.Components
},
new OsuSpriteText
{
Text = new LocalisedString((Beatmap.Value.Metadata.TitleUnicode, Beatmap.Value.Metadata.Title)),
Text = new LocalisedString((CurrentBeatmap.Value.Metadata.TitleUnicode, CurrentBeatmap.Value.Metadata.Title)),
TextSize = TextSize,
}
}, null, LinkAction.OpenBeatmap, Beatmap.Value.OnlineBeatmapID.ToString(), "Open beatmap");
}, null, LinkAction.OpenBeatmap, CurrentBeatmap.Value.OnlineBeatmapID.ToString(), "Open beatmap");
}
}
}