From 69c0e7b2e55f5596d3018e8782426db0efa787e7 Mon Sep 17 00:00:00 2001 From: trawzified Date: Tue, 6 Oct 2020 17:11:34 +0200 Subject: [PATCH] Make patching armors optional, can be configured in json --- KnowYourArmorPatcher/Program.cs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/KnowYourArmorPatcher/Program.cs b/KnowYourArmorPatcher/Program.cs index 0d2e5bc..ad0a430 100644 --- a/KnowYourArmorPatcher/Program.cs +++ b/KnowYourArmorPatcher/Program.cs @@ -271,7 +271,7 @@ List GetRecognizedKeywords(Armor armor) } // Part 3 - // Add the keywords to each armor + // Add the keywords to each armor (and optionally add descriptions) foreach (var armor in state.LoadOrder.PriorityOrder.WinningOverrides()) { if (armor.EditorID == null || ignoredArmors.Contains(armor.EditorID)) continue; @@ -292,8 +292,11 @@ List GetRecognizedKeywords(Armor armor) if (!armorKeywordsToAdd.Contains(keywordToAdd)) armorKeywordsToAdd.Add(keywordToAdd); } - string desc = GenerateDescription(state, foundEDID, armorRulesJson, effectIntensity); - if (!String.IsNullOrEmpty(desc)) armorCopy.Description = new TranslatedString(desc); + if (patchArmorDescriptions) + { + string desc = GenerateDescription(state, foundEDID, armorRulesJson, effectIntensity); + if (!String.IsNullOrEmpty(desc)) armorCopy.Description = new TranslatedString(desc); + } } if (armorRulesJson[armor.EditorID] != null) @@ -305,7 +308,7 @@ List GetRecognizedKeywords(Armor armor) } } - armorCopy.Description = new TranslatedString(GenerateDescription(state, armor.EditorID, armorRulesJson, effectIntensity)); + if (patchArmorDescriptions) armorCopy.Description = new TranslatedString(GenerateDescription(state, armor.EditorID, armorRulesJson, effectIntensity)); } // Add keywords that are to be added to armor