2023-06-23 00:37:25 +08:00
|
|
|
|
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
|
2020-03-06 15:07:54 +08:00
|
|
|
|
// See the LICENCE file in the repository root for full licence text.
|
|
|
|
|
|
|
|
|
|
using osu.Framework.Allocation;
|
|
|
|
|
using osu.Framework.Bindables;
|
2020-03-07 11:51:11 +08:00
|
|
|
|
using osu.Game.Tournament.Components;
|
2020-03-06 15:07:54 +08:00
|
|
|
|
using osu.Game.Tournament.Models;
|
|
|
|
|
|
|
|
|
|
namespace osu.Game.Tournament.Screens.Gameplay.Components
|
|
|
|
|
{
|
2022-11-24 13:32:20 +08:00
|
|
|
|
public partial class MatchRoundDisplay : TournamentSpriteTextWithBackground
|
2020-03-06 15:07:54 +08:00
|
|
|
|
{
|
2023-06-23 23:59:36 +08:00
|
|
|
|
private readonly Bindable<TournamentMatch?> currentMatch = new Bindable<TournamentMatch?>();
|
2020-03-06 15:07:54 +08:00
|
|
|
|
|
|
|
|
|
[BackgroundDependencyLoader]
|
|
|
|
|
private void load(LadderInfo ladder)
|
|
|
|
|
{
|
|
|
|
|
currentMatch.BindValueChanged(matchChanged);
|
|
|
|
|
currentMatch.BindTo(ladder.CurrentMatch);
|
|
|
|
|
}
|
|
|
|
|
|
2023-06-23 23:59:36 +08:00
|
|
|
|
private void matchChanged(ValueChangedEvent<TournamentMatch?> match) =>
|
2021-08-28 15:22:12 +08:00
|
|
|
|
Text.Text = match.NewValue?.Round.Value?.Name.Value ?? "Unknown Round";
|
2020-03-06 15:07:54 +08:00
|
|
|
|
}
|
|
|
|
|
}
|