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-08-26 01:14:18 +09:00
|
|
|
|
2022-06-17 16:37:17 +09:00
|
|
|
#nullable disable
|
|
|
|
|
2019-06-17 17:30:26 +09:00
|
|
|
using JetBrains.Annotations;
|
2018-08-26 01:14:18 +09:00
|
|
|
using osu.Framework.Allocation;
|
2019-06-17 17:30:26 +09:00
|
|
|
using osu.Framework.Bindables;
|
2018-08-26 01:14:18 +09:00
|
|
|
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-08-26 01:14:18 +09:00
|
|
|
|
2018-08-26 01:24:19 +09:00
|
|
|
namespace osu.Game.Tournament.Components
|
2018-08-26 01:14:18 +09:00
|
|
|
{
|
2022-11-24 14:32:20 +09:00
|
|
|
public abstract partial class DrawableTournamentTeam : CompositeDrawable
|
2018-08-26 01:14:18 +09:00
|
|
|
{
|
|
|
|
public readonly TournamentTeam Team;
|
|
|
|
|
2020-08-24 15:08:50 +02:00
|
|
|
protected readonly Container Flag;
|
2020-03-03 19:14:44 +09:00
|
|
|
protected readonly TournamentSpriteText AcronymText;
|
2018-08-26 01:14:18 +09:00
|
|
|
|
2019-06-17 17:30:26 +09:00
|
|
|
[UsedImplicitly]
|
|
|
|
private Bindable<string> acronym;
|
|
|
|
|
2018-08-26 01:14:18 +09:00
|
|
|
protected DrawableTournamentTeam(TournamentTeam team)
|
|
|
|
{
|
|
|
|
Team = team;
|
|
|
|
|
2020-08-24 15:08:50 +02:00
|
|
|
Flag = new DrawableTeamFlag(team);
|
2020-03-03 19:14:44 +09:00
|
|
|
AcronymText = new TournamentSpriteText
|
2018-08-26 01:14:18 +09:00
|
|
|
{
|
2020-03-03 19:14:44 +09:00
|
|
|
Font = OsuFont.Torus.With(weight: FontWeight.Regular),
|
2018-08-26 01:14:18 +09:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
2022-01-15 01:06:39 +01:00
|
|
|
private void load()
|
2018-08-26 01:14:18 +09:00
|
|
|
{
|
2019-06-17 17:30:26 +09:00
|
|
|
if (Team == null) return;
|
|
|
|
|
2022-06-24 21:25:23 +09:00
|
|
|
(acronym = Team.Acronym.GetBoundCopy()).BindValueChanged(_ => AcronymText.Text = Team?.Acronym.Value?.ToUpperInvariant() ?? string.Empty, true);
|
2018-08-26 01:14:18 +09:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|