How to remove mention of corpse in dumping stockpile?

Started by Rhyssia, February 12, 2017, 09:32:03 AM

Previous topic - Next topic

Rhyssia

I've checked this forum a few times trying to find a solution and couldn't find on regarding this.

How do I prevent corpses from showing up in the dumping stockpile list?
I've literally spent all night trying to figure out a way to get this to work from abstracts to bodysize 0 to mass 0, I mean everything you could think of. Even <fleshtype>Null<fleshtype>.

Any ideas?
Ask me about the Hardcore SK Modpack Discord Server!

Jamestec

#1
Do you mean removing the options on the left when you select a stockpile, to toggle whether to let them in the stockpile?



If you do mean those entries, you would have to do some C# stuff. You can't easily remove them from just dumping stockpiles, since in the C# code, dumping stockpiles are actually normal stockpiles but with different initial values.

Edit: nevermind, A16 is similar to A15.

You can find the code in C# at Verse.ThingFilterUI.DoThingFilterConfigWindow( ... ), the actual ticks and crosses entries (under Clear all and Allow all buttons) begin at the line:
listing_TreeThingFilter.DoCategoryChildren(node, 0, openMask, true);

To get started, you would have to get Zone_Stockpile to save whether it's a dumping or not (save as a variable or make a new class for dumping stockpiles).
You would then have to detour RimWorld.ITab_Storage.FillTab() to pass an additional argument to Verse.ThingFilterUI.DoThingFilterConfigWindow( ... ) whether it's a dumping or not.
If it's a dumping stockpile, you can either:
Edit: 1) Change the last two arguments (the null, null) of
ThingFilterUI.DoThingFilterConfigWindow(rect2, ref this.scrollPosition, settings.filter, parentFilter, 8, null, null);
to give these:
http://pastebin.com/GPQqVN3Q
To get the ThingDef from a string, use DefDatabase<ThingDef>.GetNamedSilentFail("name of def"), or get all and check if it has _Corpse.

2) Pass Verse.Listing_TreeThingFilter.DoCategoryChildren( ... ) a different TreeNode_ThingCategory node

3) Implement a different version of DoCategoryChildren which skips over Corpses.

Edit: found another way, still have to save whether it's a dumping stockpile, then detour RimWorld.Zone_Stockpile.GetParentStoreSettings() to return the a ThingFilter with the following values if it's a dumping stockpile:
http://pastebin.com/PFTxr9RF