Skip to content

Commit

Permalink
Make patching armors optional, can be configured in json
Browse files Browse the repository at this point in the history
  • Loading branch information
tr4wzified committed Oct 6, 2020
1 parent ceca1b5 commit 69c0e7b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions KnowYourArmorPatcher/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ List<string> 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<IArmorGetter>())
{
if (armor.EditorID == null || ignoredArmors.Contains(armor.EditorID)) continue;
Expand All @@ -292,8 +292,11 @@ List<string> 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)
Expand All @@ -305,7 +308,7 @@ List<string> 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
Expand Down

0 comments on commit 69c0e7b

Please sign in to comment.