diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 9f28d4bc7f..7fd0055914 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -9,6 +9,7 @@ #endregion using System; +using System.Collections.Generic; using System.Diagnostics; using System.Drawing; using System.Drawing.Imaging; @@ -255,9 +256,14 @@ namespace OpenRA public static bool IsModInstalled(string modId) { - return Manifest.AllMods[modId].RequiresMods.All(mod => ModMetadata.AllMods.ContainsKey(mod.Key) + return Manifest.AllMods[modId].RequiresMods.All(IsModInstalled); + } + + public static bool IsModInstalled(KeyValuePair mod) + { + return ModMetadata.AllMods.ContainsKey(mod.Key) && ModMetadata.AllMods[mod.Key].Version == mod.Value - && IsModInstalled(mod.Key)); + && IsModInstalled(mod.Key); } public static void InitializeMod(string mod, Arguments args) diff --git a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallModLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallModLogic.cs index e89ee00cad..b918827bdb 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallModLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/Installation/InstallModLogic.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic { var panel = widget.Get("INSTALL_MOD_PANEL"); - var mods = Manifest.AllMods[modId].RequiresMods.Select(x => "{0} ({1})".F(x.Key, x.Value)); + var mods = Manifest.AllMods[modId].RequiresMods.Where(m => !Game.IsModInstalled(m)).Select(m => "{0} ({1})".F(m.Key, m.Value)); var text = string.Join(", ", mods); panel.Get("MOD_LIST").Text = text;