mirror of
https://github.com/osukey/osukey.git
synced 2025-08-07 00:23:59 +09:00
Clean up code
This commit is contained in:
@ -219,33 +219,22 @@ namespace osu.Game.Tournament.Screens
|
|||||||
{
|
{
|
||||||
private OsuDropdown<string> dropdown;
|
private OsuDropdown<string> dropdown;
|
||||||
|
|
||||||
public IEnumerable<string> Items
|
private string startupTournament;
|
||||||
{
|
|
||||||
get => dropdown.Items;
|
|
||||||
set => dropdown.Items = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Bindable<string> Current
|
|
||||||
{
|
|
||||||
get => dropdown.Current;
|
|
||||||
set => dropdown.Current = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
private string originalTournament;
|
|
||||||
|
|
||||||
private TournamentStorage storage;
|
|
||||||
|
|
||||||
[Resolved]
|
[Resolved]
|
||||||
private TournamentGameBase game { get; set; }
|
private TournamentGameBase game { get; set; }
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
private void load(Storage storage)
|
private void load(TournamentStorage storage)
|
||||||
{
|
{
|
||||||
this.storage = (TournamentStorage)storage;
|
dropdown.Current = storage.CurrentTournament;
|
||||||
Current = this.storage.CurrentTournament;
|
dropdown.Items = storage.ListTournaments();
|
||||||
originalTournament = this.storage.CurrentTournament.Value;
|
dropdown.Current.BindValueChanged(v => Button.FadeTo(v.NewValue == startupTournament ? 0 : 1));
|
||||||
Items = this.storage.ListTournaments();
|
|
||||||
|
startupTournament = storage.CurrentTournament.Value;
|
||||||
|
|
||||||
Action = () => game.GracefullyExit();
|
Action = () => game.GracefullyExit();
|
||||||
|
|
||||||
ButtonText = "Close osu!";
|
ButtonText = "Close osu!";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,17 +247,6 @@ namespace osu.Game.Tournament.Screens
|
|||||||
Width = 510
|
Width = 510
|
||||||
});
|
});
|
||||||
|
|
||||||
Current.BindValueChanged(v =>
|
|
||||||
{
|
|
||||||
if (v.NewValue == originalTournament)
|
|
||||||
{
|
|
||||||
Button.Hide();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
Button.Show();
|
|
||||||
});
|
|
||||||
|
|
||||||
return drawable;
|
return drawable;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user