From 3effa5cec48a30f21129123eac25fb685706fb3d Mon Sep 17 00:00:00 2001 From: Paul Chote Date: Thu, 28 Dec 2017 17:53:44 +0000 Subject: [PATCH] Add a setting to disable version checks. --- OpenRA.Game/Settings.cs | 3 +++ .../Widgets/Logic/MainMenuLogic.cs | 3 ++- .../Widgets/Logic/SettingsLogic.cs | 4 ++++ mods/cnc/chrome/settings.yaml | 21 ++++++++++++------- mods/common/chrome/settings.yaml | 21 ++++++++++++------- 5 files changed, 37 insertions(+), 15 deletions(-) diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 5b38325697..8d83bba5e1 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -95,6 +95,9 @@ namespace OpenRA public bool StrictActivityChecking = false; + [Desc("Check whether a newer version is available online.")] + public bool CheckVersion = true; + [Desc("Allow the collection of anonymous data such as Operating System, .NET runtime, OpenGL version and language settings.")] public bool SendSystemInformation = true; diff --git a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs index 3a898b7c94..5b1cad113e 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/MainMenuLogic.cs @@ -239,7 +239,8 @@ namespace OpenRA.Mods.Common.Widgets.Logic // Check for updates in the background var webServices = modData.Manifest.Get(); - webServices.CheckModVersion(); + if (Game.Settings.Debug.CheckVersion) + webServices.CheckModVersion(); // System information opt-out prompt var sysInfoPrompt = widget.Get("SYSTEM_INFO_PROMPT"); diff --git a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs index c1c6542281..bbe7305183 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs @@ -489,6 +489,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic BindCheckboxPref(panel, "FETCH_NEWS_CHECKBOX", gs, "FetchNews"); BindCheckboxPref(panel, "LUADEBUG_CHECKBOX", ds, "LuaDebug"); BindCheckboxPref(panel, "SENDSYSINFO_CHECKBOX", ds, "SendSystemInformation"); + BindCheckboxPref(panel, "CHECK_VERSION_CHECKBOX", ds, "CheckVersion"); BindCheckboxPref(panel, "REPLAY_COMMANDS_CHECKBOX", ds, "EnableDebugCommandsInReplays"); return () => { }; @@ -509,6 +510,9 @@ namespace OpenRA.Mods.Common.Widgets.Logic ds.SanityCheckUnsyncedCode = dds.SanityCheckUnsyncedCode; ds.BotDebug = dds.BotDebug; ds.LuaDebug = dds.LuaDebug; + ds.SendSystemInformation = dds.SendSystemInformation; + ds.CheckVersion = dds.CheckVersion; + ds.EnableDebugCommandsInReplays = dds.EnableDebugCommandsInReplays; }; } diff --git a/mods/cnc/chrome/settings.yaml b/mods/cnc/chrome/settings.yaml index a535722844..a1ebef3be9 100644 --- a/mods/cnc/chrome/settings.yaml +++ b/mods/cnc/chrome/settings.yaml @@ -542,51 +542,58 @@ Container@SETTINGS_PANEL: Height: 20 Font: Regular Text: Fetch Community News - Checkbox@SENDSYSINFO_CHECKBOX: + Checkbox@CHECK_VERSION_CHECKBOX: X: 310 Y: 70 Width: 300 Height: 20 Font: Regular + Text: Check for Updates + Checkbox@SENDSYSINFO_CHECKBOX: + X: 310 + Y: 100 + Width: 300 + Height: 20 + Font: Regular Text: Send System Information Label@SENDSYSINFO_DESC: X: 310 - Y: 85 + Y: 115 Width: 250 Height: 30 Font: Tiny WordWrap: True Text: Your Operating System, OpenGL and .NET runtime versions, and language settings will be sent along with an anonymous ID to help prioritize future development. Label@DEBUG_TITLE: - Y: 170 + Y: 200 Width: PARENT_RIGHT Font: Bold Text: Debug Align: Center Checkbox@BOTDEBUG_CHECKBOX: X: 15 - Y: 190 + Y: 220 Width: 300 Height: 20 Font: Regular Text: Show Bot Debug Messages Checkbox@CHECKUNSYNCED_CHECKBOX: X: 15 - Y: 220 + Y: 250 Width: 300 Height: 20 Font: Regular Text: Check Sync around Unsynced Code Checkbox@LUADEBUG_CHECKBOX: X: 310 - Y: 190 + Y: 220 Width: 300 Height: 20 Font: Regular Text: Show Map Debug Messages Checkbox@REPLAY_COMMANDS_CHECKBOX: X: 310 - Y: 220 + Y: 250 Width: 300 Height: 20 Font: Regular diff --git a/mods/common/chrome/settings.yaml b/mods/common/chrome/settings.yaml index 98f2f1b760..ef77f42082 100644 --- a/mods/common/chrome/settings.yaml +++ b/mods/common/chrome/settings.yaml @@ -553,51 +553,58 @@ Background@SETTINGS_PANEL: Height: 20 Font: Regular Text: Fetch Community News - Checkbox@SENDSYSINFO_CHECKBOX: + Checkbox@CHECK_VERSION_CHECKBOX: X: 310 Y: 70 Width: 300 Height: 20 Font: Regular + Text: Check for Updates + Checkbox@SENDSYSINFO_CHECKBOX: + X: 310 + Y: 100 + Width: 300 + Height: 20 + Font: Regular Text: Send System Information Label@SENDSYSINFO_DESC: X: 310 - Y: 85 + Y: 115 Width: 250 Height: 30 Font: Tiny WordWrap: True Text: Your Operating System, OpenGL and .NET runtime versions, and language settings will be sent along with an anonymous ID to help prioritize future development. Label@DEBUG_TITLE: - Y: 170 + Y: 200 Width: PARENT_RIGHT Font: Bold Text: Debug Align: Center Checkbox@BOTDEBUG_CHECKBOX: X: 15 - Y: 190 + Y: 220 Width: 300 Height: 20 Font: Regular Text: Show Bot Debug Messages Checkbox@CHECKUNSYNCED_CHECKBOX: X: 15 - Y: 220 + Y: 250 Width: 300 Height: 20 Font: Regular Text: Check Sync around Unsynced Code Checkbox@LUADEBUG_CHECKBOX: X: 310 - Y: 190 + Y: 220 Width: 300 Height: 20 Font: Regular Text: Show Map Debug Messages Checkbox@REPLAY_COMMANDS_CHECKBOX: X: 310 - Y: 220 + Y: 250 Width: 300 Height: 20 Font: Regular