Move the version check code to WebServices and run only on first launch.

This commit is contained in:
Paul Chote
2017-12-28 17:32:38 +00:00
committed by abcdefg30
parent 759bd044ed
commit 0208d0cc10
5 changed files with 71 additions and 55 deletions

View File

@@ -237,7 +237,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Game.OnRemoteDirectConnect += OnRemoteDirectConnect;
var newsURL = modData.Manifest.Get<WebServices>().GameNews;
// Check for updates in the background
var webServices = modData.Manifest.Get<WebServices>();
webServices.CheckModVersion();
// System information opt-out prompt
var sysInfoPrompt = widget.Get("SYSTEM_INFO_PROMPT");
@@ -267,11 +269,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Game.Settings.Debug.SystemInformationVersionPrompt = SystemInformationVersion;
Game.Settings.Save();
SwitchMenu(MenuType.Main);
LoadAndDisplayNews(newsURL, newsBG);
LoadAndDisplayNews(webServices.GameNews, newsBG);
};
}
else
LoadAndDisplayNews(newsURL, newsBG);
LoadAndDisplayNews(webServices.GameNews, newsBG);
}
void LoadAndDisplayNews(string newsURL, Widget newsBG)