Ludeon Forums

Ludeon Forums

  • July 20, 2019, 01:27:04 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

Author Topic: How to remove mention of corpse in dumping stockpile?  (Read 499 times)

Rhyssia

  • Colonist
  • ***
  • Posts: 134
  • Universally Derped
    • View Profile
How to remove mention of corpse in dumping stockpile?
« on: February 12, 2017, 09:32:03 AM »

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?
« Last Edit: February 12, 2017, 09:40:35 AM by Rhyssia »
Logged
Ask me about the Hardcore SK Modpack Discord Server!

Jamestec

  • Drifter
  • **
  • Posts: 51
  • u wot m8
    • View Profile
Re: How to remove mention of corpse in dumping stockpile?
« Reply #1 on: February 13, 2017, 01:49:32 AM »

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:
Code: [Select]
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
Code: [Select]
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