mirror of
https://github.com/ppy/osu.git
synced 2025-03-21 20:17:21 +08:00
Merge pull request #21154 from peppy/seeding-fixes
Fix multiple issues with seeding screen in tournament client
This commit is contained in:
commit
980acb0a13
@ -256,7 +256,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
mods.BindValueChanged(modString => Model.Mods = modString.NewValue);
|
||||
}
|
||||
|
||||
private void updatePanel()
|
||||
private void updatePanel() => Schedule(() =>
|
||||
{
|
||||
drawableContainer.Clear();
|
||||
|
||||
@ -269,7 +269,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
||||
Width = 300
|
||||
};
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -26,6 +26,9 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
||||
|
||||
private readonly Bindable<TournamentTeam> currentTeam = new Bindable<TournamentTeam>();
|
||||
|
||||
private TourneyButton showFirstTeamButton;
|
||||
private TourneyButton showSecondTeamButton;
|
||||
|
||||
[BackgroundDependencyLoader]
|
||||
private void load()
|
||||
{
|
||||
@ -46,13 +49,13 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
||||
{
|
||||
Children = new Drawable[]
|
||||
{
|
||||
new TourneyButton
|
||||
showFirstTeamButton = new TourneyButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Show first team",
|
||||
Action = () => currentTeam.Value = CurrentMatch.Value.Team1.Value,
|
||||
},
|
||||
new TourneyButton
|
||||
showSecondTeamButton = new TourneyButton
|
||||
{
|
||||
RelativeSizeAxes = Axes.X,
|
||||
Text = "Show second team",
|
||||
@ -70,35 +73,48 @@ 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)
|
||||
{
|
||||
base.CurrentMatchChanged(match);
|
||||
|
||||
if (match.NewValue == null)
|
||||
{
|
||||
showFirstTeamButton.Enabled.Value = false;
|
||||
showSecondTeamButton.Enabled.Value = false;
|
||||
return;
|
||||
}
|
||||
|
||||
showFirstTeamButton.Enabled.Value = true;
|
||||
showSecondTeamButton.Enabled.Value = true;
|
||||
|
||||
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
|
||||
{
|
||||
|
@ -238,7 +238,7 @@ namespace osu.Game.Tournament
|
||||
var beatmapsRequiringPopulation = ladder.Teams
|
||||
.SelectMany(r => r.SeedingResults)
|
||||
.SelectMany(r => r.Beatmaps)
|
||||
.Where(b => b.Beatmap?.OnlineID == 0 && b.ID > 0).ToList();
|
||||
.Where(b => (b.Beatmap == null || b.Beatmap.OnlineID == 0) && b.ID > 0).ToList();
|
||||
|
||||
if (beatmapsRequiringPopulation.Count == 0)
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user