mirror of https://github.com/ppy/osu
add reload tournaments list button to tourney setup screen
This commit is contained in:
parent
bc46502deb
commit
e0fe5c77d5
|
@ -15,6 +15,7 @@ internal partial class TournamentSwitcher : ActionableInfo
|
||||||
{
|
{
|
||||||
private OsuDropdown<string> dropdown;
|
private OsuDropdown<string> dropdown;
|
||||||
private OsuButton folderButton;
|
private OsuButton folderButton;
|
||||||
|
private OsuButton reloadTournamentsButton;
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private TournamentGameBase game { get; set; }
|
private TournamentGameBase game { get; set; }
|
||||||
|
@ -28,6 +29,9 @@ private void load(TournamentStorage storage)
|
||||||
dropdown.Items = storage.ListTournaments();
|
dropdown.Items = storage.ListTournaments();
|
||||||
dropdown.Current.BindValueChanged(v => Button.Enabled.Value = v.NewValue != startupTournament, true);
|
dropdown.Current.BindValueChanged(v => Button.Enabled.Value = v.NewValue != startupTournament, true);
|
||||||
|
|
||||||
|
reloadTournamentsButton.Enabled.Value = true;
|
||||||
|
reloadTournamentsButton.Action = () => dropdown.Items = storage.ListTournaments();
|
||||||
|
|
||||||
Action = () =>
|
Action = () =>
|
||||||
{
|
{
|
||||||
game.RestartAppWhenExited();
|
game.RestartAppWhenExited();
|
||||||
|
@ -48,7 +52,13 @@ protected override Drawable CreateComponent()
|
||||||
Width = BUTTON_SIZE
|
Width = BUTTON_SIZE
|
||||||
});
|
});
|
||||||
|
|
||||||
FlowContainer.Insert(-2, dropdown = new OsuDropdown<string>
|
FlowContainer.Insert(-2, reloadTournamentsButton = new RoundedButton
|
||||||
|
{
|
||||||
|
Text = "Reload list",
|
||||||
|
Width = BUTTON_SIZE
|
||||||
|
});
|
||||||
|
|
||||||
|
FlowContainer.Insert(-3, dropdown = new OsuDropdown<string>
|
||||||
{
|
{
|
||||||
Width = 510
|
Width = 510
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue