Redesign classes and generally improve code

This commit is contained in:
Craftplacer
2020-06-08 00:39:33 +02:00
parent e95ffcb528
commit 101604e741
4 changed files with 43 additions and 49 deletions

View File

@ -1,6 +1,7 @@
// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence.
// See the LICENCE file in the repository root for full licence text.
using System.Threading.Tasks;
using osu.Framework;
using osu.Framework.Allocation;
using osu.Framework.Platform;
@ -28,15 +29,12 @@ namespace osu.Game.Overlays.Settings.Sections.General
});
// We should only display the button for UpdateManagers that do check for updates
if (updateManager?.CanCheckForUpdate == true)
Add(new SettingsButton
{
Add(new SettingsButton
{
Text = "Check for updates",
Action = updateManager.CheckForUpdate,
Enabled = { Value = game.IsDeployedBuild }
});
}
Text = "Check for updates",
Action = () => Schedule(() => Task.Run(updateManager.CheckForUpdateAsync)),
Enabled = { Value = updateManager.CanCheckForUpdate }
});
if (RuntimeInfo.IsDesktop)
{