add reload tournaments list button to tourney setup screen

This commit is contained in:
Dao Heng Liu 2023-07-22 09:44:02 +01:00
parent bc46502deb
commit e0fe5c77d5
No known key found for this signature in database
GPG Key ID: 76B315615CDDAFDE
1 changed files with 11 additions and 1 deletions

View File

@ -15,6 +15,7 @@ internal partial class TournamentSwitcher : ActionableInfo
{
private OsuDropdown<string> dropdown;
private OsuButton folderButton;
private OsuButton reloadTournamentsButton;
[Resolved]
private TournamentGameBase game { get; set; }
@ -28,6 +29,9 @@ private void load(TournamentStorage storage)
dropdown.Items = storage.ListTournaments();
dropdown.Current.BindValueChanged(v => Button.Enabled.Value = v.NewValue != startupTournament, true);
reloadTournamentsButton.Enabled.Value = true;
reloadTournamentsButton.Action = () => dropdown.Items = storage.ListTournaments();
Action = () =>
{
game.RestartAppWhenExited();
@ -48,7 +52,13 @@ protected override Drawable CreateComponent()
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
});