mirror of
https://github.com/ppy/osu.git
synced 2025-03-28 02:27:19 +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);
|
mods.BindValueChanged(modString => Model.Mods = modString.NewValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void updatePanel()
|
private void updatePanel() => Schedule(() =>
|
||||||
{
|
{
|
||||||
drawableContainer.Clear();
|
drawableContainer.Clear();
|
||||||
|
|
||||||
@ -269,7 +269,7 @@ namespace osu.Game.Tournament.Screens.Editors
|
|||||||
Width = 300
|
Width = 300
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,6 +26,9 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
|||||||
|
|
||||||
private readonly Bindable<TournamentTeam> currentTeam = new Bindable<TournamentTeam>();
|
private readonly Bindable<TournamentTeam> currentTeam = new Bindable<TournamentTeam>();
|
||||||
|
|
||||||
|
private TourneyButton showFirstTeamButton;
|
||||||
|
private TourneyButton showSecondTeamButton;
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load()
|
private void load()
|
||||||
{
|
{
|
||||||
@ -46,13 +49,13 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
|||||||
{
|
{
|
||||||
Children = new Drawable[]
|
Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new TourneyButton
|
showFirstTeamButton = new TourneyButton
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Text = "Show first team",
|
Text = "Show first team",
|
||||||
Action = () => currentTeam.Value = CurrentMatch.Value.Team1.Value,
|
Action = () => currentTeam.Value = CurrentMatch.Value.Team1.Value,
|
||||||
},
|
},
|
||||||
new TourneyButton
|
showSecondTeamButton = new TourneyButton
|
||||||
{
|
{
|
||||||
RelativeSizeAxes = Axes.X,
|
RelativeSizeAxes = Axes.X,
|
||||||
Text = "Show second team",
|
Text = "Show second team",
|
||||||
@ -70,35 +73,48 @@ namespace osu.Game.Tournament.Screens.TeamIntro
|
|||||||
currentTeam.BindValueChanged(teamChanged, true);
|
currentTeam.BindValueChanged(teamChanged, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void teamChanged(ValueChangedEvent<TournamentTeam> team) => Scheduler.AddOnce(() =>
|
private void teamChanged(ValueChangedEvent<TournamentTeam> team) => updateTeamDisplay();
|
||||||
{
|
|
||||||
if (team.NewValue == null)
|
|
||||||
{
|
|
||||||
mainContainer.Clear();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
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)
|
protected override void CurrentMatchChanged(ValueChangedEvent<TournamentMatch> match)
|
||||||
{
|
{
|
||||||
base.CurrentMatchChanged(match);
|
base.CurrentMatchChanged(match);
|
||||||
|
|
||||||
if (match.NewValue == null)
|
if (match.NewValue == null)
|
||||||
|
{
|
||||||
|
showFirstTeamButton.Enabled.Value = false;
|
||||||
|
showSecondTeamButton.Enabled.Value = false;
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
showFirstTeamButton.Enabled.Value = true;
|
||||||
|
showSecondTeamButton.Enabled.Value = true;
|
||||||
|
|
||||||
currentTeam.Value = match.NewValue.Team1.Value;
|
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[]
|
mainContainer.Children = new Drawable[]
|
||||||
{
|
{
|
||||||
new LeftInfo(team) { Position = new Vector2(55, 150), },
|
new LeftInfo(currentTeam.Value) { Position = new Vector2(55, 150), },
|
||||||
new RightInfo(team) { Position = new Vector2(500, 150), },
|
new RightInfo(currentTeam.Value) { Position = new Vector2(500, 150), },
|
||||||
};
|
};
|
||||||
}
|
});
|
||||||
|
|
||||||
private class RightInfo : CompositeDrawable
|
private class RightInfo : CompositeDrawable
|
||||||
{
|
{
|
||||||
|
@ -238,7 +238,7 @@ namespace osu.Game.Tournament
|
|||||||
var beatmapsRequiringPopulation = ladder.Teams
|
var beatmapsRequiringPopulation = ladder.Teams
|
||||||
.SelectMany(r => r.SeedingResults)
|
.SelectMany(r => r.SeedingResults)
|
||||||
.SelectMany(r => r.Beatmaps)
|
.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)
|
if (beatmapsRequiringPopulation.Count == 0)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user