From a5a371f1ffa74cb1bc5f59f02b4559284cf210f8 Mon Sep 17 00:00:00 2001 From: Vapre Date: Mon, 12 Apr 2021 22:30:39 +0200 Subject: [PATCH] GameSettings, EnableDiscordService. --- OpenRA.Game/Settings.cs | 3 +++ OpenRA.Mods.Common/DiscordService.cs | 3 +++ 2 files changed, 6 insertions(+) diff --git a/OpenRA.Game/Settings.cs b/OpenRA.Game/Settings.cs index 5fd32b3e53..a0eafc43f4 100644 --- a/OpenRA.Game/Settings.cs +++ b/OpenRA.Game/Settings.cs @@ -262,6 +262,9 @@ namespace OpenRA public MPGameFilters MPGameFilters = MPGameFilters.Waiting | MPGameFilters.Empty | MPGameFilters.Protected | MPGameFilters.Started; public bool PauseShellmap = false; + + [Desc("Allow mods to enable the Discord service that can interact with a local Discord client.")] + public bool EnableDiscordService = true; } public class Settings diff --git a/OpenRA.Mods.Common/DiscordService.cs b/OpenRA.Mods.Common/DiscordService.cs index c404ecdb73..c405e5bd0f 100644 --- a/OpenRA.Mods.Common/DiscordService.cs +++ b/OpenRA.Mods.Common/DiscordService.cs @@ -43,6 +43,9 @@ namespace OpenRA.Mods.Common if (instance != null) return instance; + if (!Game.Settings.Game.EnableDiscordService) + return null; + if (!Game.ModData.Manifest.Contains()) return null;