Jump to content

Editor GUI Details


Ontresanas

Recommended Posts

I'm trying to show details for a custom module in the VAB, so that users can compare different parts with the module like they can for, say, a battery.

MODULE
{
name = RTGModule
FuelHalflife = 2300400 // one-quarter of a kerbin year
ElectricityPerSecond = 0.002
HeatPerSecond = 0.012
InitialFuel = 30
}

If a player were to right-click on a part containing this module, I'd want it to perhaps say something like:

Half-Life: 106.5 days

Initial Electric Generation: 3.6 E/m

How would I go about doing something like this properly?

Link to comment
Share on other sites

Assuming RTGModule is something you wrote, you would add a "public override string GetInfo()" method. Return a string with whatever information you want displayed. It supports unity's rich text format if you want something with color, italics, etc.

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