Ludeon Forums

RimWorld => Mods => Help => Topic started by: pidggit on May 05, 2014, 12:12:18 AM

Title: Creating new Context Menu Items or Designations
Post by: pidggit on May 05, 2014, 12:12:18 AM
Has anyone successfully added a new Designation (Item to the Orders tab to give jobs) or added new items to the Context Menu of a Pawn (Where you can Capture/Arrest wandering Pawns).

After looking over the the code, they both look fairly hard coded.

Failing that, any ideas on how I could add a whole new Job to be done? I'm looking to have Colonists tame the dogs I've added to the game.
Title: Re: Creating new Context Menu Items or Designations
Post by: pawnstorm on May 05, 2014, 01:08:49 AM
If it's possible to add a designator, maybe my PagedArchitect source can help you on your way. I don't have access to my main computer at the moment so I have to do this from memory, but maybe you can extend the incidentmaker classes to load your new designator in their constructor at game start, and then add it to the appropriate List<Designator> which also gets passed to the constructor of the designator panels in tabarchitect. The downside of using this method would be that your mod will be incompatible with PagedArchitect or any future mods that might use this method.

Or you could extend Pawn like I did in BattleFormations and add a command button to your dogs to tame them. The benefit of this option would be that if you only apply the extended class to your dogs, it should still work with other mods that do something similar.

I don't have any idea how to add items to the context menu, haven't really tried that yet.

Edit: The nicest way would probably be to create a ThingComp CompTamable class and add the command button there. I tried to create a class like that for human pawns though, and it didn't show the command buttons, so I have a feeling it might not work for animals either. But it could be worth a try.