Jump to content

How to add custom categories ?


Recommended Posts

In his last version of RealChute, chris added it's own "Parachutes" category in the Function filter of the editor. It's done with simple C# in his plugin, the source can be found here. But it's only a filter, wich show all the parts with RealChuteModule, and not a "real" category that you could put in a part cfg like this:


category = Parachutes
subcategory = 0
title = Mk16-XL Parachute

Doing so will crash KSP. So the question is, how to create new categories, not just filters ?

I know the categories names are all listed in the "PartCategories" enum, but I don't know how to modify it.

Link to comment
Share on other sites

I, too, would like to know this. The feature is very interesting, and would be awesome to have that available for more mods, or even for personal user customization.

I think it is possible to do that by reading KSP Stock data (if we're allowed to do that), looking for how they created the original categories. Once that's discovered, if you can replicate that, you can easily create something to edit that in-game, and use ModuleManager patches to edit each part's category, behind the curtains.

Link to comment
Share on other sites

You can't. You can really just add more filters. At best you could add also add another of the buttons in the advanced mode, like "Filter by Function" and "Filter by Module". You can add another category like this, and then add filters to it, but really, you can't just create an enum member on the run. That's set in stone unfortunately.

I, too, would like to know this. The feature is very interesting, and would be awesome to have that available for more mods, or even for personal user customization.

I think it is possible to do that by reading KSP Stock data (if we're allowed to do that), looking for how they created the original categories. Once that's discovered, if you can replicate that, you can easily create something to edit that in-game, and use ModuleManager patches to edit each part's category, behind the curtains.

You can't browse the source of KSP, no. But as I said, the categories are a public enum object, and you can't add a member to an enum.

Edited by stupid_chris
Link to comment
Share on other sites

This thread is quite old. Please consider starting a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...