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-08-26 00:14:18 +08:00
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
using osu.Framework.Graphics;
|
|
|
|
using osu.Framework.Graphics.Containers;
|
|
|
|
using osu.Framework.Graphics.Sprites;
|
|
|
|
using osu.Framework.Graphics.Textures;
|
2019-05-15 12:10:58 +08:00
|
|
|
using osu.Game.Graphics;
|
2018-08-26 00:14:18 +08:00
|
|
|
using osu.Game.Graphics.Sprites;
|
|
|
|
|
2018-08-26 00:24:19 +08:00
|
|
|
namespace osu.Game.Tournament.Components
|
2018-08-26 00:14:18 +08:00
|
|
|
{
|
|
|
|
public abstract class DrawableTournamentTeam : CompositeDrawable
|
|
|
|
{
|
|
|
|
public readonly TournamentTeam Team;
|
|
|
|
|
|
|
|
protected readonly Sprite Flag;
|
|
|
|
protected readonly OsuSpriteText AcronymText;
|
|
|
|
|
|
|
|
protected DrawableTournamentTeam(TournamentTeam team)
|
|
|
|
{
|
|
|
|
Team = team;
|
|
|
|
|
|
|
|
Flag = new Sprite
|
|
|
|
{
|
|
|
|
RelativeSizeAxes = Axes.Both,
|
|
|
|
FillMode = FillMode.Fit
|
|
|
|
};
|
|
|
|
|
|
|
|
AcronymText = new OsuSpriteText
|
|
|
|
{
|
2018-09-22 04:52:25 +08:00
|
|
|
Text = team?.Acronym?.ToUpperInvariant() ?? string.Empty,
|
2019-05-15 12:10:58 +08:00
|
|
|
Font = OsuFont.GetFont(weight: FontWeight.Regular),
|
2018-08-26 00:14:18 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
private void load(TextureStore textures)
|
|
|
|
{
|
|
|
|
if (Team != null)
|
|
|
|
Flag.Texture = textures.Get($@"Flags/{Team.FlagName}");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|