1
0
mirror of https://github.com/ppy/osu.git synced 2024-11-16 18:27:31 +08:00
osu-lazer/osu.Game.Tournament/Components/DrawableTournamentTeam.cs

44 lines
1.3 KiB
C#
Raw Normal View History

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