1
0
mirror of https://github.com/ppy/osu.git synced 2025-03-07 05:07:21 +08:00

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

59 lines
2.1 KiB
C#
Raw Normal View History

2019-03-04 13:24:19 +09: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-25 00:57:44 +09:00
2022-06-17 16:37:17 +09:00
#nullable disable
using JetBrains.Annotations;
using osu.Framework.Bindables;
2018-09-25 00:57:44 +09:00
using osu.Framework.Graphics;
using osu.Framework.Graphics.Containers;
2019-05-15 13:10:58 +09:00
using osu.Game.Graphics;
2019-06-18 14:51:48 +09:00
using osu.Game.Tournament.Models;
2018-09-25 00:57:44 +09:00
2018-09-25 04:21:48 +09:00
namespace osu.Game.Tournament.Screens.Ladder.Components
2018-09-25 00:57:44 +09:00
{
2019-06-18 14:44:15 +09:00
public partial class DrawableTournamentRound : CompositeDrawable
2018-09-25 00:57:44 +09:00
{
[UsedImplicitly]
private readonly Bindable<string> name;
[UsedImplicitly]
private readonly Bindable<string> description;
2019-06-18 14:44:15 +09:00
public DrawableTournamentRound(TournamentRound round, bool losers = false)
2018-09-25 00:57:44 +09:00
{
TournamentSpriteText textName;
TournamentSpriteText textDescription;
2018-09-25 00:57:44 +09:00
AutoSizeAxes = Axes.Both;
InternalChild = new FillFlowContainer
{
Direction = FillDirection.Vertical,
AutoSizeAxes = Axes.Both,
Children = new Drawable[]
{
textDescription = new TournamentSpriteText
2018-09-25 00:57:44 +09:00
{
Colour = TournamentGame.TEXT_COLOUR,
2018-09-25 00:57:44 +09:00
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre
},
textName = new TournamentSpriteText
2018-09-25 00:57:44 +09:00
{
Font = OsuFont.Torus.With(weight: FontWeight.Bold),
Colour = TournamentGame.TEXT_COLOUR,
2018-09-25 00:57:44 +09:00
Origin = Anchor.TopCentre,
Anchor = Anchor.TopCentre
},
}
};
2019-06-18 14:44:15 +09:00
name = round.Name.GetBoundCopy();
2022-06-24 21:25:23 +09:00
name.BindValueChanged(_ => textName.Text = ((losers ? "Losers " : "") + round.Name).ToUpperInvariant(), true);
description = round.Description.GetBoundCopy();
2022-06-24 21:25:23 +09:00
description.BindValueChanged(_ => textDescription.Text = round.Description.Value?.ToUpperInvariant(), true);
2018-09-25 00:57:44 +09:00
}
}
}