Avoid sending HTTP requests to the FetchNews URL when FetchNews is disabled
Also disables the 'Send SysInfo' settings checkbox when 'Fetch News' is disabled as well.
This commit is contained in:
committed by
reaperrr
parent
d21b959bf0
commit
3e29ef0bd6
@@ -287,7 +287,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
|
|
||||||
void LoadAndDisplayNews(string newsURL, Widget newsBG)
|
void LoadAndDisplayNews(string newsURL, Widget newsBG)
|
||||||
{
|
{
|
||||||
if (newsBG != null)
|
if (newsBG != null && Game.Settings.Game.FetchNews)
|
||||||
{
|
{
|
||||||
var cacheFile = Platform.ResolvePath(Platform.SupportDirPrefix, "news.yaml");
|
var cacheFile = Platform.ResolvePath(Platform.SupportDirPrefix, "news.yaml");
|
||||||
var currentNews = ParseNews(cacheFile);
|
var currentNews = ParseNews(cacheFile);
|
||||||
|
|||||||
@@ -492,6 +492,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
BindCheckboxPref(panel, "CHECK_VERSION_CHECKBOX", ds, "CheckVersion");
|
BindCheckboxPref(panel, "CHECK_VERSION_CHECKBOX", ds, "CheckVersion");
|
||||||
BindCheckboxPref(panel, "REPLAY_COMMANDS_CHECKBOX", ds, "EnableDebugCommandsInReplays");
|
BindCheckboxPref(panel, "REPLAY_COMMANDS_CHECKBOX", ds, "EnableDebugCommandsInReplays");
|
||||||
|
|
||||||
|
var ssi = panel.Get<CheckboxWidget>("SENDSYSINFO_CHECKBOX");
|
||||||
|
ssi.IsDisabled = () => !gs.FetchNews;
|
||||||
|
|
||||||
return () => { };
|
return () => { };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user