1
0
mirror of https://github.com/ppy/osu.git synced 2025-02-14 04:52:55 +08:00

Line endings.

This commit is contained in:
DrabWeb 2017-06-24 05:23:31 -03:00
parent 05b5fe8ae7
commit 35951ffc40

View File

@ -1,142 +1,142 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using OpenTK; using OpenTK;
using osu.Framework.Allocation; using osu.Framework.Allocation;
using osu.Framework.Graphics; using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers; using osu.Framework.Graphics.Containers;
using osu.Framework.Graphics.Shapes; using osu.Framework.Graphics.Shapes;
using osu.Game.Graphics; using osu.Game.Graphics;
using osu.Game.Graphics.Sprites; using osu.Game.Graphics.Sprites;
using osu.Game.Users; using osu.Game.Users;
namespace osu.Game.Screens.Multiplayer namespace osu.Game.Screens.Multiplayer
{ {
public class ParticipantInfo : Container public class ParticipantInfo : Container
{ {
private readonly Container flagContainer; private readonly Container flagContainer;
private readonly OsuSpriteText host; private readonly OsuSpriteText host;
private readonly FillFlowContainer levelRangeContainer; private readonly FillFlowContainer levelRangeContainer;
private readonly OsuSpriteText levelRangeLower; private readonly OsuSpriteText levelRangeLower;
private readonly OsuSpriteText levelRangeHigher; private readonly OsuSpriteText levelRangeHigher;
public User Host public User Host
{ {
set set
{ {
host.Text = value.Username; host.Text = value.Username;
flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName ?? @"__") { RelativeSizeAxes = Axes.Both } }; flagContainer.Children = new[] { new DrawableFlag(value.Country?.FlagName ?? @"__") { RelativeSizeAxes = Axes.Both } };
} }
} }
public IEnumerable<User> Participants public IEnumerable<User> Participants
{ {
set set
{ {
var ranks = value.Select(u => u.GlobalRank); var ranks = value.Select(u => u.GlobalRank);
levelRangeLower.Text = ranks.Min().ToString(); levelRangeLower.Text = ranks.Min().ToString();
levelRangeHigher.Text = ranks.Max().ToString(); levelRangeHigher.Text = ranks.Max().ToString();
} }
} }
public ParticipantInfo(string rankPrefix = null) public ParticipantInfo(string rankPrefix = null)
{ {
RelativeSizeAxes = Axes.X; RelativeSizeAxes = Axes.X;
Height = 15f; Height = 15f;
Children = new Drawable[] Children = new Drawable[]
{ {
new FillFlowContainer new FillFlowContainer
{ {
AutoSizeAxes = Axes.X, AutoSizeAxes = Axes.X,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Spacing = new Vector2(5f, 0f), Spacing = new Vector2(5f, 0f),
Children = new Drawable[] Children = new Drawable[]
{ {
flagContainer = new Container flagContainer = new Container
{ {
Width = 22f, Width = 22f,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
}, },
new Container //todo: team banners new Container //todo: team banners
{ {
Width = 38f, Width = 38f,
RelativeSizeAxes = Axes.Y, RelativeSizeAxes = Axes.Y,
CornerRadius = 2f, CornerRadius = 2f,
Masking = true, Masking = true,
Children = new[] Children = new[]
{ {
new Box new Box
{ {
RelativeSizeAxes = Axes.Both, RelativeSizeAxes = Axes.Both,
Colour = OsuColour.FromHex(@"ad387e"), Colour = OsuColour.FromHex(@"ad387e"),
}, },
}, },
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = "hosted by", Text = "hosted by",
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
TextSize = 14, TextSize = 14,
}, },
host = new OsuSpriteText host = new OsuSpriteText
{ {
Anchor = Anchor.CentreLeft, Anchor = Anchor.CentreLeft,
Origin = Anchor.CentreLeft, Origin = Anchor.CentreLeft,
TextSize = 14, TextSize = 14,
Font = @"Exo2.0-BoldItalic", Font = @"Exo2.0-BoldItalic",
}, },
}, },
}, },
levelRangeContainer = new FillFlowContainer levelRangeContainer = new FillFlowContainer
{ {
Anchor = Anchor.CentreRight, Anchor = Anchor.CentreRight,
Origin = Anchor.CentreRight, Origin = Anchor.CentreRight,
AutoSizeAxes = Axes.Both, AutoSizeAxes = Axes.Both,
Direction = FillDirection.Horizontal, Direction = FillDirection.Horizontal,
Children = new[] Children = new[]
{ {
new OsuSpriteText new OsuSpriteText
{ {
Text = rankPrefix, Text = rankPrefix,
TextSize = 14, TextSize = 14,
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = "#", Text = "#",
TextSize = 14, TextSize = 14,
}, },
levelRangeLower = new OsuSpriteText levelRangeLower = new OsuSpriteText
{ {
TextSize = 14, TextSize = 14,
Font = @"Exo2.0-Bold", Font = @"Exo2.0-Bold",
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = " - ", Text = " - ",
TextSize = 14, TextSize = 14,
}, },
new OsuSpriteText new OsuSpriteText
{ {
Text = "#", Text = "#",
TextSize = 14, TextSize = 14,
}, },
levelRangeHigher = new OsuSpriteText levelRangeHigher = new OsuSpriteText
{ {
TextSize = 14, TextSize = 14,
Font = @"Exo2.0-Bold", Font = @"Exo2.0-Bold",
}, },
}, },
}, },
}; };
} }
[BackgroundDependencyLoader] [BackgroundDependencyLoader]
private void load(OsuColour colours) private void load(OsuColour colours)
{ {
levelRangeContainer.Colour = colours.Gray9; levelRangeContainer.Colour = colours.Gray9;
host.Colour = colours.Blue; host.Colour = colours.Blue;
} }
} }
} }