Jump to content

Making part module display in the editor


Guest

Recommended Posts

You need to tag your partModule with one of the interfaces introduced in KSP 1.0 or 1.1. I think it's IPartInfo that you need.

I've not used it myself but googling that should get you the documentation on how to implement it.

D.

edit: Of course having said that I can't google it up myself, the exact name will have to wait a bit until I can get on my KSP computer.

Edited by Diazo
Link to comment
Share on other sites

Just now, linuxgurugamer said:

Can you post an example?

		private string info = string.Empty;
        public override string GetInfo()
        {
            info = "Maximum Pressure: " + maxPressure;
            return info;
        }

All you need to do is return a string value

@Crzyrndm - Do you know how I'd be able to display info in the way electric charge is displayed, also?

Link to comment
Share on other sites

Alright, the name of the interface I was thinking of is IModuleInfo.

GetInfo() is included in that method, but if you add the IModuleInfo it looks like you can get more detailed control with the GetModuleTitle and GetPrimaryField methods that offers.

D.

Link to comment
Share on other sites

11 minutes ago, Diazo said:

Alright, the name of the interface I was thinking of is IModuleInfo.

GetInfo() is included in that method, but if you add the IModuleInfo it looks like you can get more detailed control with the GetModuleTitle and GetPrimaryField methods that offers.

D.

That did the trick.  Thanks!

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