2019-03-04 12:24:19 +08:00
|
|
|
// 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.
|
2018-09-24 23:57:44 +08:00
|
|
|
|
2019-06-14 19:30:09 +08:00
|
|
|
using JetBrains.Annotations;
|
|
|
|
using osu.Framework.Bindables;
|
2018-09-24 23:57:44 +08:00
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
2019-05-15 12:10:58 +08:00
|
|
|
using osu.Game.Graphics;
|
2018-09-24 23:57:44 +08:00
|
|
|
using osu.Game.Graphics.Sprites;
|
2019-06-18 13:51:48 +08:00
|
|
|
using osu.Game.Tournament.Models;
|
2018-11-22 09:25:30 +08:00
|
|
|
using osuTK.Graphics;
|
2018-09-24 23:57:44 +08:00
|
|
|
|
2018-09-25 03:21:48 +08:00
|
|
|
namespace osu.Game.Tournament.Screens.Ladder.Components
|
2018-09-24 23:57:44 +08:00
|
|
|
{
|
2019-06-18 13:44:15 +08:00
|
|
|
public class DrawableTournamentRound : CompositeDrawable
|
2018-09-24 23:57:44 +08:00
|
|
|
{
|
2019-06-14 19:30:09 +08:00
|
|
|
[UsedImplicitly]
|
|
|
|
private readonly Bindable<string> name;
|
|
|
|
|
|
|
|
[UsedImplicitly]
|
|
|
|
private readonly Bindable<string> description;
|
|
|
|
|
2019-06-18 13:44:15 +08:00
|
|
|
public DrawableTournamentRound(TournamentRound round, bool losers = false)
|
2018-09-24 23:57:44 +08:00
|
|
|
{
|
2019-06-14 19:30:09 +08:00
|
|
|
OsuSpriteText textName;
|
|
|
|
OsuSpriteText textDescription;
|
|
|
|
|
2018-09-24 23:57:44 +08:00
|
|
|
AutoSizeAxes = Axes.Both;
|
|
|
|
InternalChild = new FillFlowContainer
|
|
|
|
{
|
|
|
|
Direction = FillDirection.Vertical,
|
|
|
|
AutoSizeAxes = Axes.Both,
|
|
|
|
Children = new Drawable[]
|
|
|
|
{
|
2019-06-14 19:30:09 +08:00
|
|
|
textDescription = new OsuSpriteText
|
2018-09-24 23:57:44 +08:00
|
|
|
{
|
2018-10-18 01:17:54 +08:00
|
|
|
Colour = Color4.Black,
|
2018-09-24 23:57:44 +08:00
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
Anchor = Anchor.TopCentre
|
|
|
|
},
|
2019-06-14 19:30:09 +08:00
|
|
|
textName = new OsuSpriteText
|
2018-09-24 23:57:44 +08:00
|
|
|
{
|
2019-05-15 12:10:58 +08:00
|
|
|
Font = OsuFont.GetFont(weight: FontWeight.Bold),
|
2018-10-18 01:17:54 +08:00
|
|
|
Colour = Color4.Black,
|
2018-09-24 23:57:44 +08:00
|
|
|
Origin = Anchor.TopCentre,
|
|
|
|
Anchor = Anchor.TopCentre
|
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
2019-06-14 19:30:09 +08:00
|
|
|
|
2019-06-18 13:44:15 +08:00
|
|
|
name = round.Name.GetBoundCopy();
|
|
|
|
name.BindValueChanged(n => textName.Text = ((losers ? "Losers " : "") + round.Name).ToUpper(), true);
|
2019-06-14 19:30:09 +08:00
|
|
|
|
2019-06-18 13:44:15 +08:00
|
|
|
description = round.Name.GetBoundCopy();
|
|
|
|
description.BindValueChanged(n => textDescription.Text = round.Description.Value.ToUpper(), true);
|
2018-09-24 23:57:44 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|