Allow news per mod.
This commit is contained in:
committed by
Paul Chote
parent
9d179d9a1a
commit
e7af295b5e
@@ -23,6 +23,7 @@ namespace OpenRA.Mods.Common
|
|||||||
public readonly string ServerAdvertise = "https://master.openra.net/ping";
|
public readonly string ServerAdvertise = "https://master.openra.net/ping";
|
||||||
public readonly string MapRepository = "https://resource.openra.net/map/";
|
public readonly string MapRepository = "https://resource.openra.net/map/";
|
||||||
public readonly string GameNews = "https://master.openra.net/gamenews";
|
public readonly string GameNews = "https://master.openra.net/gamenews";
|
||||||
|
public readonly string GameNewsFileName = "news.yaml";
|
||||||
public readonly string VersionCheck = "https://master.openra.net/versioncheck";
|
public readonly string VersionCheck = "https://master.openra.net/versioncheck";
|
||||||
|
|
||||||
public ModVersionStatus ModVersionStatus { get; private set; }
|
public ModVersionStatus ModVersionStatus { get; private set; }
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
{
|
{
|
||||||
Action onSysInfoComplete = () =>
|
Action onSysInfoComplete = () =>
|
||||||
{
|
{
|
||||||
LoadAndDisplayNews(webServices.GameNews, newsBG);
|
LoadAndDisplayNews(webServices, newsBG);
|
||||||
SwitchMenu(MenuType.Main);
|
SwitchMenu(MenuType.Main);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -260,11 +260,11 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
DiscordService.UpdateStatus(DiscordState.InMenu);
|
DiscordService.UpdateStatus(DiscordState.InMenu);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LoadAndDisplayNews(string newsURL, Widget newsBG)
|
void LoadAndDisplayNews(WebServices webServices, Widget newsBG)
|
||||||
{
|
{
|
||||||
if (newsBG != null && Game.Settings.Game.FetchNews)
|
if (newsBG != null && Game.Settings.Game.FetchNews)
|
||||||
{
|
{
|
||||||
var cacheFile = Platform.ResolvePath(Platform.SupportDirPrefix, "news.yaml");
|
var cacheFile = Platform.ResolvePath(Platform.SupportDirPrefix, webServices.GameNewsFileName);
|
||||||
var currentNews = ParseNews(cacheFile);
|
var currentNews = ParseNews(cacheFile);
|
||||||
if (currentNews != null)
|
if (currentNews != null)
|
||||||
DisplayNews(currentNews);
|
DisplayNews(currentNews);
|
||||||
@@ -275,7 +275,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
if (!fetchedNews)
|
if (!fetchedNews)
|
||||||
{
|
{
|
||||||
// Send the mod and engine version to support version-filtered news (update prompts)
|
// Send the mod and engine version to support version-filtered news (update prompts)
|
||||||
newsURL += "?version={0}&mod={1}&modversion={2}".F(
|
var newsURL = "{0}?version={1}&mod={2}&modversion={3}".F(
|
||||||
|
webServices.GameNews,
|
||||||
Uri.EscapeUriString(Game.EngineVersion),
|
Uri.EscapeUriString(Game.EngineVersion),
|
||||||
Uri.EscapeUriString(Game.ModData.Manifest.Id),
|
Uri.EscapeUriString(Game.ModData.Manifest.Id),
|
||||||
Uri.EscapeUriString(Game.ModData.Manifest.Metadata.Version));
|
Uri.EscapeUriString(Game.ModData.Manifest.Metadata.Version));
|
||||||
|
|||||||
Reference in New Issue
Block a user