1
0
mirror of https://github.com/ppy/osu.git synced 2024-12-25 22:23:04 +08:00
osu-lazer/osu.Game.Tournament/Components/DrawableTeamSeed.cs

46 lines
1.2 KiB
C#
Raw Normal View History

// 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 osu.Framework.Allocation;
using osu.Framework.Bindables;
using osu.Game.Tournament.Models;
namespace osu.Game.Tournament.Components
{
public partial class DrawableTeamSeed : TournamentSpriteTextWithBackground
{
private readonly TournamentTeam? team;
private IBindable<string> seed = null!;
private Bindable<bool> displaySeed = null!;
public DrawableTeamSeed(TournamentTeam? team)
{
this.team = team;
}
[Resolved]
private LadderInfo ladder { get; set; } = null!;
2023-10-31 11:40:21 +08:00
[BackgroundDependencyLoader]
private void load()
{
Text.Font = Text.Font.With(size: 36);
}
protected override void LoadComplete()
{
base.LoadComplete();
if (team == null)
return;
seed = team.Seed.GetBoundCopy();
seed.BindValueChanged(s => Text.Text = s.NewValue, true);
displaySeed = ladder.DisplayTeamSeeds.GetBoundCopy();
displaySeed.BindValueChanged(v => Alpha = v.NewValue ? 1 : 0, true);
}
}
}