Skip to content

Commit

Permalink
Hide disabled ammo from research
Browse files Browse the repository at this point in the history
  • Loading branch information
Safairette committed Dec 21, 2024
1 parent 7f60142 commit 51ff798
Showing 1 changed file with 20 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System.Collections.Generic;
using HarmonyLib;
using RimWorld;
using Verse;

namespace CombatExtended
{
[HarmonyPatch(typeof(ResearchPrerequisitesUtility), nameof(ResearchPrerequisitesUtility.UnlockedDefsGroupedByPrerequisites))]
public class Harmony_ResearchPrerequisitesUtility
{
public static List<Pair<ResearchPrerequisitesUtility.UnlockedHeader, List<Def>>> Postfix(List<Pair<ResearchPrerequisitesUtility.UnlockedHeader, List<Def>>> input)
{
foreach (var pair in input)
{
pair.second.RemoveWhere(x => x is AmmoDef ammoDef && ammoDef.menuHidden);
}
return input;
}
}
}

0 comments on commit 51ff798

Please sign in to comment.