Allow nulls and hide if missing dependencies

This commit is contained in:
Craftplacer
2020-05-08 00:33:33 +02:00
parent 92872496b8
commit 72b6bb25a5

View File

@ -13,7 +13,7 @@ namespace osu.Game.Overlays.Settings.Sections.General
{ {
protected override string Header => "Updates"; protected override string Header => "Updates";
[BackgroundDependencyLoader] [BackgroundDependencyLoader(true)]
private void load(Storage storage, OsuConfigManager config, OsuGameBase game, UpdateManager updateManager) private void load(Storage storage, OsuConfigManager config, OsuGameBase game, UpdateManager updateManager)
{ {
Add(new SettingsEnumDropdown<ReleaseStream> Add(new SettingsEnumDropdown<ReleaseStream>
@ -22,12 +22,15 @@ namespace osu.Game.Overlays.Settings.Sections.General
Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream), Bindable = config.GetBindable<ReleaseStream>(OsuSetting.ReleaseStream),
}); });
Add(new SettingsButton if (game != null && updateManager != null)
{ {
Text = "Check for updates", Add(new SettingsButton
Action = updateManager.CheckForUpdate, {
Enabled = { Value = game.IsDeployedBuild } Text = "Check for updates",
}); Action = updateManager.CheckForUpdate,
Enabled = { Value = game.IsDeployedBuild }
});
}
if (RuntimeInfo.IsDesktop) if (RuntimeInfo.IsDesktop)
{ {