1
0
mirror of https://github.com/ppy/osu.git synced 2024-09-21 21:27:24 +08:00

Ensure seeding screen is refreshed on entering

This commit is contained in:
Dean Herbert 2022-11-07 18:46:04 +09:00
parent cb6b9898c1
commit de2dac22b8

View File

@ -70,16 +70,16 @@ namespace osu.Game.Tournament.Screens.TeamIntro
currentTeam.BindValueChanged(teamChanged, true);
}
private void teamChanged(ValueChangedEvent<TournamentTeam> team) => Scheduler.AddOnce(() =>
{
if (team.NewValue == null)
{
mainContainer.Clear();
return;
}
private void teamChanged(ValueChangedEvent<TournamentTeam> team) => updateTeamDisplay();
showTeam(team.NewValue);
});
public override void Show()
{
base.Show();
// Changes could have been made on editor screen.
// Rather than trying to track all the possibilities (teams / players / scores) just force a full refresh.
updateTeamDisplay();
}
protected override void CurrentMatchChanged(ValueChangedEvent<TournamentMatch> match)
{
@ -91,14 +91,20 @@ namespace osu.Game.Tournament.Screens.TeamIntro
currentTeam.Value = match.NewValue.Team1.Value;
}
private void showTeam(TournamentTeam team)
private void updateTeamDisplay() => Scheduler.AddOnce(() =>
{
if (currentTeam.Value == null)
{
mainContainer.Clear();
return;
}
mainContainer.Children = new Drawable[]
{
new LeftInfo(team) { Position = new Vector2(55, 150), },
new RightInfo(team) { Position = new Vector2(500, 150), },
new LeftInfo(currentTeam.Value) { Position = new Vector2(55, 150), },
new RightInfo(currentTeam.Value) { Position = new Vector2(500, 150), },
};
}
});
private class RightInfo : CompositeDrawable
{