From e0fe5c77d56722ef93afbcab6f2769dc9841e835 Mon Sep 17 00:00:00 2001 From: Dao Heng Liu Date: Sat, 22 Jul 2023 09:44:02 +0100 Subject: [PATCH] add reload tournaments list button to tourney setup screen --- .../Screens/Setup/TournamentSwitcher.cs | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/osu.Game.Tournament/Screens/Setup/TournamentSwitcher.cs b/osu.Game.Tournament/Screens/Setup/TournamentSwitcher.cs index 2d57757ad9..0852161db8 100644 --- a/osu.Game.Tournament/Screens/Setup/TournamentSwitcher.cs +++ b/osu.Game.Tournament/Screens/Setup/TournamentSwitcher.cs @@ -15,6 +15,7 @@ internal partial class TournamentSwitcher : ActionableInfo { private OsuDropdown 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 + FlowContainer.Insert(-2, reloadTournamentsButton = new RoundedButton + { + Text = "Reload list", + Width = BUTTON_SIZE + }); + + FlowContainer.Insert(-3, dropdown = new OsuDropdown { Width = 510 });