Jump to content

How to add part statistics in editor?


Recommended Posts

Does anyone have information on how to add new part statistics to the right click list in the editor.  This is the right click in the parts GUI, not the tweakables.  If you have a guide or some code examples that would be useful, thanks!

Link to comment
Share on other sites

Well, I figured it out.  For anybody that needs to know, you have to implement IModuleInfo.

        public string GetModuleTitle()
        {
            return "Title";
        }

        public override string GetInfo()
        {
            return "Info";
        }

        public Callback<Rect> GetDrawModulePanelCallback()
        {
            return null;
        }

Produces:

Gi5aa47.png

Edited by Alshain
Link to comment
Share on other sites

You don't need IModuleInfo, overriding GetInfo with something other than an empty string is enough to get your module added to the list. I guess IModuleInfo just allows for a bit more customization.

To add color you can just use "<color=#FFFFFF></color>" tags. And to add the check marks you can use RUIUtils.GetYesNoUIString(bool).

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...