From 996f090a7accbb5fc65012d58fd64ae4897a2e27 Mon Sep 17 00:00:00 2001 From: Denis Belan Date: Wed, 27 Dec 2023 23:55:15 +0300 Subject: [PATCH] Adds option that allows to use MechTags in TagsRestriction configs. --- source/CustomComponents/CustomComponentSettings.cs | 1 + source/CustomComponents/TagRestrictions/TagsChecker.cs | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/source/CustomComponents/CustomComponentSettings.cs b/source/CustomComponents/CustomComponentSettings.cs index cb3b13b..7d8a798 100644 --- a/source/CustomComponents/CustomComponentSettings.cs +++ b/source/CustomComponents/CustomComponentSettings.cs @@ -162,6 +162,7 @@ public class CustomComponentSettings public bool FixDefaults = true; public bool TagRestrictionDropValidateRequiredTags = false; public bool TagRestrictionDropValidateIncompatibleTags = true; + public bool TagRestrictionUseMechTags = false; public bool CheckCriticalComponent = true; public bool UseDefaultFixedColor = false; public bool AddWeightToCategory = true; diff --git a/source/CustomComponents/TagRestrictions/TagsChecker.cs b/source/CustomComponents/TagRestrictions/TagsChecker.cs index caeca18..777126e 100644 --- a/source/CustomComponents/TagRestrictions/TagsChecker.cs +++ b/source/CustomComponents/TagRestrictions/TagsChecker.cs @@ -21,6 +21,11 @@ internal TagsChecker(MechDef mechDef) chassisDef = mechDef.Chassis; inventory = mechDef.Inventory.ToList(); + if (Control.Settings.TagRestrictionUseMechTags) + { + tagsOnMech.UnionWith(mechDef.MechTags); + } + CollectChassisTags(); CollectComponentTags(); }