Check whether the build is deployed within the public check updates method

This commit is contained in:
Craftplacer
2020-05-08 02:48:27 +02:00
parent e6ad28a1cb
commit 3c24ca08d0
2 changed files with 18 additions and 9 deletions

View File

@ -26,16 +26,22 @@ namespace osu.Game.Updater
[Resolved]
private GameHost host { get; set; }
private OsuGameBase gameBase;
[BackgroundDependencyLoader]
private void load(OsuGameBase game)
{
gameBase = game;
version = game.Version;
if (game.IsDeployedBuild)
CheckForUpdate();
CheckForUpdate();
}
public override void CheckForUpdate() => Schedule(() => Task.Run(checkForUpdateAsync));
public override void CheckForUpdate()
{
if (gameBase.IsDeployedBuild)
Schedule(() => Task.Run(checkForUpdateAsync));
}
private async void checkForUpdateAsync()
{