Skip to content

Commit

Permalink
Add custom check for parts that have TechHidden = True. These are eit…
Browse files Browse the repository at this point in the history
…her deprecated parts, or parts that are forced hidden for whatever reason (i.e. Restock + parts that are modified via patch if Making History is detected).
  • Loading branch information
leatherneck6017 committed Mar 2, 2020
1 parent 04f74f3 commit d600bf1
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion FilterExtension/Utility/PartType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,11 @@ public static bool CheckCustom(AvailablePart part, string[] value)
case "purchased":
testVal = ResearchAndDevelopment.PartModelPurchased(part);
break;
}

case "hidden":
testVal = IsHidden(part);
break;
}
if (testVal)
{
return true;
Expand Down Expand Up @@ -953,6 +957,14 @@ public static bool IsAdapter(AvailablePart part)
}
return part.partPrefab.attachNodes[0].size != part.partPrefab.attachNodes[1].size;
}

/// <summary>
/// checks if the part is supposed to be hidden (i.e. deprecated)
/// </summary>
public static bool IsHidden(AvailablePart part)
{
return part.TechHidden;
}

public static bool Contains(string[] CheckParams, IEnumerable<string> partParams, bool contains = true, bool exact = false)
{
Expand Down

0 comments on commit d600bf1

Please sign in to comment.