Hi E,
Thought I'd leave my two cents on your unresolved issue, in case it helps at all. Plus I guess I need to make my first post on these forums at some point
I'm in the process of making my own RimWorld mod and found this thread when searching for info on how to do similar things. Now, the way I ended up getting this to work isn't actually the same thing, so depending on how you want things to work this may or may not work. I did make my own attempts to get your method working, to no avail.
Rather than removing buildings from the menu by changing the designationCategory I decided to try using research to hide/unhide them. By changing the researchPrerequisite you can get a similar result. They'll all still show up when in God Mode, but that shouldn't really be a serious problem.
I also noticed research projects can basically be locked permanently by setting themselves as a prerequisite. So I created a permalocked research that never even shows up in game, like so:
<ResearchProjectDef>
<defName>Permalocked</defName>
<label>permalocked</label>
<totalCost>99999</totalCost>
<prerequisites>
<li>Permalocked</li>
</prerequisites>
</ResearchProjectDef>
And wrote an extension method for ThingDef that acts on one ThingDef (the one to remove) and takes another ThingDef (the one to add):
public static class Extensions
{
public static string lockedResearch = "Permalocked";
public static void ReplaceInMenu(this ThingDef pOld, ThingDef pNew, ResearchProjectDef pResearchToHideWith = null)
{
pOld.researchPrerequisite = (pResearchToHideWith == null ? ResearchProjectDef.Named(lockedResearch) : pResearchToHideWith);
pNew.researchPrerequisite = (ResearchProjectDef)null;
}
}
A call to it would look like so:
ThingDef.Named("ThingToLock").ReplaceInMenu(ThingDef.Named("ThingToUnlock"));
Now this is just a stripped down version of what I'm using, to illustrate what I'm doing. Since I'm swapping one item for another when completing research, this works nicely. But of course could be changed to work for other situations.
Hope this helps in some way! I know it's not quite what you were after, but does mimic the result for the most part. And if I've done anything horribly wrong or undesirable, please let me know. This mod is my first time using C# and most of my coding experience before this point has been with scripting languages.
PS: Loving the game, Tynan! This is the first game that's truly inspired me to make a full-fledged mod, learning C# in the process. I look forward to seeing what RimWorld will become over time.