osu/osu.Game.Tournament/Components/DrawableTournamentTeam.cs

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

45 lines
1.3 KiB
C#
Raw Normal View History

2019-03-04 04:24:19 +00: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.
2022-06-17 07:37:17 +00:00
#nullable disable
using JetBrains.Annotations;
using osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Framework.Graphics.Containers;
2019-05-15 04:10:58 +00:00
using osu.Game.Graphics;
2019-06-18 05:51:48 +00:00
using osu.Game.Tournament.Models;
2018-08-25 16:24:19 +00:00
namespace osu.Game.Tournament.Components
{
public abstract class DrawableTournamentTeam : CompositeDrawable
{
public readonly TournamentTeam Team;
protected readonly Container Flag;
protected readonly TournamentSpriteText AcronymText;
[UsedImplicitly]
private Bindable<string> acronym;
protected DrawableTournamentTeam(TournamentTeam team)
{
Team = team;
Flag = new DrawableTeamFlag(team);
AcronymText = new TournamentSpriteText
{
Font = OsuFont.Torus.With(weight: FontWeight.Regular),
};
}
[BackgroundDependencyLoader]
2022-01-15 00:06:39 +00:00
private void load()
{
if (Team == null) return;
(acronym = Team.Acronym.GetBoundCopy()).BindValueChanged(acronym => AcronymText.Text = Team?.Acronym.Value?.ToUpperInvariant() ?? string.Empty, true);
}
}
}