Jump to content

[1.8.x - 1.12.x] PartInfoInPAW: get full part MM patches history, copy/open part CFG in editor, get useful information about part from PAW menu


Judicator81

Recommended Posts

PartInfoInPAW [0.3.0]

Mod for Kerbal Space Program intended for mod creators and advanced players.
Get useful information about part from PAW menu (including full module manager patches history), copy part ID or CFG to clipboard, open part CFG (original or in-game presentation) in editor with one click.

What does this mod do?

1. It displays part name (basically, part ID) and path to part CFG file in the parts list (in VAB/Hangar):
        x889rHz.png

This feature is more or less identical to PartInfo mod by linuxgurugamer.

2. PartInfoInPAW also adds some information to PAW menu (right-click menu) for alls parts (works only in VAB/SPH). This information includes:

  •    part name (basically, part ID);
  •    part mod (GameData folder name);
  •    dry/wet mass (takes into account crew mass for KSP 1.11+);
  •    empty/full cost (takes into account crew inventories cost for KSP 1.11+);
  •    entry cost;
  •    current and maximum crew (only for crewable parts).

        YEQNnRE.png

      For engines, mod also display propellants information, thrust and ISP, minimum thrust (in %, and only if engine has non-zero minThrust) and engine gimbal information. If part has more than one ModuleEngines (for example, multi-mode engine like RAPIER), information for first two ModuleEngines will be displayed. RealFuels/RO, KSPIE and other engines are all supported).

         OvDfYXS.png

3. Mod adds several buttons to PAW menu:

  •     Сopy part name - copy part name (ID) to clipboard;
  •     Copy orig. CFG file / Open orig. CFG in editor - copy original part CFG file to clipboard / opens it in system default editor for .cfg files;
  •     Copy part CFG node / Open CFG node in editor - copy part CFG to clipboard / save it to temporary file and open in system default editor for .cfg files. Important: "part CFG" here means actual in-game part representation, not text from original part CFG-file. That means, whole PART{} node with all MM-patches already applied to it;
  •     MM patches history - opens window with history all module manager patches. See screenshot:

         o9CXClM.png

4. All buttons and information options are configurable in game difficulty settings. Choose which options you want to see in PAW menu.

        ZJF09LX.png

 

No dependencies

As of version 0.3.0, PartInfoInPAW no longer relies on module manager patch for adding itself to every part. Instead, mod do so automatically during KSP startup.
Downside is, mod only works in editor scene now (VAB/Hangar).

Licensing

The MIT License (MIT)

Copyright (c) 2022-2024 Alexander Rogov

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

 

Changelog

Spoiler

0.3.0

  • Added buttons "Open CFG node in editor" and "Open orig. CFG in editor" to PAW menu. Both buttons open corresponding file in system default editor for .cfg files.
  • Added crew / maximum crew information to PAW menu.
  • For KSP 1.11+ displayed wet part mass and cost takes into account kerbonauts mass and their inventories mass/cost.
  • Engine information in PAW menu was completely overhauled. Now it also contains gimbal information, as well as other useful parameters, depending on engine type. Near/Far Future, KSPIE, RealFuels/RO are supported.
  • New button "MM patches history" opens window with tree-like structure of all module manager patches, applied to part, in order of appliance. Information about patches is parsed from module manager cache.
  • Mod menu options and buttons are now fully configurable in game difficulty settings ("Part Info in PAW" section).
  • PartInfoInPAW adds itself to each and every part during game load. MM patch, adding partmodule to all parts, is no longer needed and is deprecated.
  • Mod now only works in VAB/Hangar and is no more available in flight scene.
  • Perfomance improvements and code cleanup.

0.2.3

  • Fixed "Copy Part CFG to Clipboard" not working for parts, having spaces in their cfg-file path (for example, Coatl Aerospace mod).
  • Minor UI improvement: buttons "Copy Part ID to Clipboard" and "Copy Part CFG to Clipboard" now generate on-screen messages then pressed.
  • Added part temperature and skin temperature (current/max) to PAW menu, but only for flight scene and if showInfoInFlight is true (see README).

0.2.2

  • Slightly changed info format in Parts selection window. Now full path to part CFG file is displayed. PAW menu still has only basic mod folder info to avoid clutter.
  • Updated README.

 

0.2.1

  • Added mod folder parameter to displayed information. For some mods (like Bluedog_DB or USI family) 2 or 3 nested mod folder levels are shown (for example, "Bluedog_DB/Parts_Atlas" instead of just "Bluedog_DB").
  • Localization implemented, added russian localization.

0.2.0

  • Part mass information now include dry and wet (if part contain any resources) mass.
  • Added buttons: "copy part name to clipboard" and "copy part CFF node to clipboard". Could be useful for debug purposes.
  • Code improvements.

0.1.1

  • Information in PAW menu is now properly updated, then part variant (B9PartSwitch) is changed.

0.1.0

  • Initial release.

 

Downloads

Source: https://github.com/judicator/PartInfoInPAW

Edited by Judicator81
0.3.0
Link to comment
Share on other sites

I totally agree on the copy part name and copy part config. That is something modders and advanced players who "like" to write ModuleManager configuration will find invaluable.

For players who are not aware, the ".cfg" is a textual representation of the configuration of a part. They are defined in ".cfg" files (the KSP wiki even has a link to them for each part).

ModuleManager is pretty much a required mod for most mods which has ".cfg" language extensions to modify those definitions when the game loads, using extensions in mod or user supplied ".cfg" files. So, with enough persistence and reading, you can totally change parts, add new variants, ... become a modder! Often non-part mods supply configuration using the same system.

So, this tool will make it a lot easier to fiddle with a part:

  • Find the part you want to fix in the game editor
  • Copy the cfg to clipboard
  • Paste it into notepad
  • Modify it to be a ModuleManager style patch for that part (go read the ModuleManager forum posts and wiki, or any mods cfg files)
  • Fix whatever you didn't like
  • Save somewhere in GameData
  • Load the game again (MM has a reload option, but it's best used to make iteration a little quicker: I recommend a separate CKAN minimal modded install for testing)

There are plenty of examples of how to do this, pretty much every mod has ".cfg" files in them.

Link to comment
Share on other sites

15 hours ago, 610yesnolovely said:

So, this tool will make it a lot easier to fiddle with a part:

  • Find the part you want to fix in the game editor
  • Copy the cfg to clipboard
  • Paste it into notepad
  • Modify it to be a ModuleManager style patch for that part (go read the ModuleManager forum posts and wiki, or any mods cfg files)
  • Fix whatever you didn't like
  • Save somewhere in GameData
  • Load the game again (MM has a reload option, but it's best used to make iteration a little quicker: I recommend a separate CKAN minimal modded install for testing)

There are plenty of examples of how to do this, pretty much every mod has ".cfg" files in them.

Not sure, but I think there is some misunderstanding here. And it's actually my fault: mod description could be more clear.
So, button "Copy part CFG node" copies actual in-game part representation, not text from original part CFG-file. That means, whole PART{} node with all MM-patches already applied.

You can think of it as of copy of respective PART{} from ModuleManager.ConfigCache file. Apart from the fact, that actual ModuleManager.ConfigCache is not required.

Thus, this feature is likely more useful for "inspecting" your own or third-party changes to specific part(s) (made with MM-patches), rather than creating new MM-patches.
But it's up to you, how you would like to use it, of course.

Link to comment
Share on other sites

10 hours ago, Judicator81 said:

Not sure, but I think there is some misunderstanding here. And it's actually my fault: mod description could be more clear.
So, button "Copy part CFG node" copies actual in-game part representation, not text from original part CFG-file. That means, whole PART{} node with all MM-patches already applied.

You can think of it as of copy of respective PART{} from ModuleManager.ConfigCache file. Apart from the fact, that actual ModuleManager.ConfigCache is not required.

Thus, this feature is likely more useful for "inspecting" your own or third-party changes to specific part(s) (made with MM-patches), rather than creating new MM-patches.
But it's up to you, how you would like to use it, of course.

Absolutely, and I should have made it clear that this is true and how I thought your mod works. Still super useful, especially for starting out, though figuring out how to write MM patches is quite an adventure. My recommendation is to look at mod and user patches, read the MM wiki and forum posts and start with something simple (clone a part and change the name/description, and perhaps some minor functionality).

Some personal patches I've seen recommended:

https://github.com/Wallum/KSP-Patches

Link to comment
Share on other sites

On 11/7/2022 at 8:38 AM, Judicator81 said:

PartInfoInPAW [0.2.2]

Mod for Kerbal Space Program intended for mod creators and advanced players.
Get useful information about part from PAW menu, copy part ID or full part CFG node to clipboard with one click.

What does this mod do?

1. It displays part name (basically, part ID) and path to part CFG file in the parts list (in VAB/Hangar):
 

This feature is more or less identical to PartInfo mod by linuxgurugamer.

Looks like a nice little mod

Link to comment
Share on other sites

  • 4 months later...

Version 0.2.3 released.

Changelog:

  • Fixed "Copy Part CFG to Clipboard" not working for parts, having spaces in their cfg-file path (for example, Coatl Aerospace mod).
  • Minor UI improvement: buttons "Copy Part ID to Clipboard" and "Copy Part CFG to Clipboard" now generate on-screen messages then pressed.
  • Added part temperature and skin temperature (current/max) to PAW menu, but only for flight scene and if showInfoInFlight is true (see README).

 

Link to comment
Share on other sites

  • 1 year later...

Version 0.3.0 released.

Changelog:

  • Added buttons "Open CFG node in editor" and "Open orig. CFG in editor" to PAW menu. Both buttons open corresponding file in system default editor for .cfg files.
  • Added crew / maximum crew information to PAW menu.
  • For KSP 1.11+ displayed wet part mass and cost takes into account kerbonauts mass and their inventories mass/cost.
  • Engine information in PAW menu was completely overhauled. Now it also contains gimbal information, as well as other useful parameters, depending on engine type. Near/Far Future, KSPIE, RealFuels/RO are supported.
  • New button "MM patches history" opens window with tree-like structure of all module manager patches, applied to part, in order of appliance. Information about patches is parsed from module manager cache.
  • Mod menu options and buttons are now fully configurable in game difficulty settings ("Part Info in PAW" section).
  • PartInfoInPAW adds itself to each and every part during game load. MM patch, adding partmodule to all parts, is no longer needed and is deprecated.
  • Mod now only works in VAB/Hangar and is no more available in flight scene.
  • Perfomance improvements and code cleanup.

 

Link to comment
Share on other sites

31 minutes ago, Rodger said:

Wow, open cfg in editor and MM patch history sounds so good! I was literally just thinking the other day how I wished "open cfg in editor" existed :D

Yep, opening CFG in editor directly definitely saves some button hits/clicks. That's why "copy CFG to clipboard buttons" are now disabled by default.

Link to comment
Share on other sites

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