Jump to content

[1.12.x] End your parts list nightmare - Introducing The Janitor's Closet


linuxgurugamer

Recommended Posts

Janitor's Closet

The new version for KSP 1.4.1 has new dependencies

Dependency

New Dependency

CKAN has been updated to install the dependencies, if needed.

You are a serious player. You have dozens if not hundreds of mods install. Your part list is extreme!

What do you do when the plumbing is clogged? You call the janitor. For the problem of too many parts, you use the Janitor's Closet

Description This mod will allow you to block parts from being displayed in the Editor, either on a soft basis or hard basis. The difference is that a soft basis doesn't do anything to the parts, it merely blocks the parts from being displayed. In this case, the parts are still loaded. This would be useful in an ongoing career, where you have ships with parts you don't use anymore, but are still active. A hard basis is where the files get renamed so that none of the parts or their assets will be loaded. This can speed up loading a game, but is potentially game-breaking, in that if you prune a part and it is in use on a vessel, the vessel will be deleted the next time you start the game. There is also the ability to export a list of all blocked parts, so that you can either import it into another game or send it to someone else.

The PermaPrune was added based on a request from a user.  I don't particularly like it, renaming parts is too prone to problems.  That being said, I think I've gotten all the problems fixed (as of 0.0.3)

Many thanks to @xEvilReeperx, who patiently answered my questions about some KSP internals and wrote some code which is included in the mod.

Thanks to @Papa_Joe for pointing me to a fix for the click-through problem

Patreon.png

https://www.patreon.com/linuxgurugamer
 

PayPal

 

Note

Download from:

Alternate Download for older versions of KSP

https://github.com/linuxgurugamer/JanitorsCloset/releases

 

New Features in update 0.3.5

  • Fixed resource filter to also filter on propellants used by engines & RCS
  • Optimized filters a bit
  • Added an inverse filter, to exclude specific mods/ size/resources
  • Fixed the "Reset All" button to properly reset the Resources filters
  • Added help screen to mod filter window
  • Fixed inability to save Mod Filter Window settings properly
  • Added PartModule filter
  • Added Module Blacklist (ignores modules in the blacklist)
  • Added ReadableNames list
  • Added Module Filter screen

There is now a new file:  PluginData/filtersConfig.cfg.  It contains two types of information at present:

  • Module Blacklist - List of modules which will be ignored by the PartModule Filter
  • ReadableNames - List of module names and how each module is presented in the filter window.  If an unknown module is found, Janitor's Closet will make a "best guess" as to what a readable version of the module name would be, and saves it in this file.  Keep in mind that this file will be replaced whenever JC is updated, so if you have a better readable name for a part module, please let me know and I'll incorporate it in the next release

Review by Kottabos Space Program

 

Instructions 

In the editor (VAB or SPH), hold the Alt key while clicking on a part. A two line menu will be shown, giving you the option to block the part in the scene you are currently in (VAB or SPH), or block it entirely:

ALJAgp4.png

 

This does the soft blocking, where it isn't changed, but just blocked from displaying. There is a toolbar button, of a broom & dustbin. Hovering the mouse over it will display a popup menu:

02ajeCB.png

ShowBlocked will display a list of all parts blocked, and, if a soft basis, a button so you can unblock a single part Unblock will unblock all parts which are blocked via the soft basis

PermaPrune will display a new menu with the following:

2Qpjh3j.png

Permanent Prune will permanently rename files to prevent them from being loaded. It will only do this to parts which are blocked everywhere. Undo Permanent Prune will undo all the permanently pruned files

Import/Export will display a new menu with the following: 

iqIfj3A.png

Export will present a dialog where you can name the list of pruned parts you are exporting. Export lists are always saved to the GameData/JanitorsCloset/PluginData directory, with a suffix of ".prnlst", and the full path is stored in the system clipboard after the export:

nyUwlYC.png

 Import will present a file dialog where you can select a file to import.   It starts in the PluginData directory, but you can go anywhere to find a file. Again, it only displays files which have the suffix ".prnlst".:

2rrozTO.png

 

Toolbar Functionality

Toolbar buttons can be hidden, either in the current screen or everywhere.  This is somewhat misleading, since all hidden buttons are still available by clicking on the Janitor’s Closet toolbar button.

Toolbar buttons can also be moved to folders, either a new folder or an existing one.

Modes of Operation

No hidden buttons (ie: when first starting)

If no buttons have been hidden, then clicking on the Janitor’s Closet button will open a help window with these instructions

If in the editor, hovering over the button will bring up the toolbar popup menu, with the following buttons:

Show Blocked
Unblock
PermaPrune
Mod Filter
Export/Import
 

ShowBlocked will display a list of all parts blocked, and, if a soft basis, a button so you can unblock a single part
Unblock will unblock all parts which are blocked via the soft basis
.

PermaPrune will display a new menu 

Mod Filter will display a window where you can select which mods you want to filter (ie:  show parts from)

Import/Export will display a new menu

Hidden Buttons

Clicking on the Janitor’s Closet button will show all buttons which are hidden in the current scene

Toolbar Operations

Any toolbar button can be hidden, either on the current scene or all scenes.  Any toolbar button can be moved, either to a new or existing button folder.  To activate this, hold the ALT button (on Windows) and right-click the button you want to hide/move.  Linux and OSX users need to use the MOD button for their system.  A popup menu will be displayed, with the following:

Hide here
Hide everywhere
Move to new folder
and, if there are already folders created and displayed, there will be an additional button for each folder on the toolbar, with the folder displayed followed by the words “Move to folder”

Hide here will remove the button from the toolbar in this scene only

Hide everywhere will remove the button from the toolbar in all scenes

Move to new folder will create a new button folder and move this button into the new button folder

Move to folder will move this button into the selected button folder


Button Folders

Button folders are new buttons added to hold other buttons.  At present you can’t select which icon to use for a new folder.  They look like a colored folder with the broom & dustbin on top.

Moving the mouse over a button folder will do an instant popup toolbar perpendicular to the current toolbar showing all the buttons in the toolbar.  Moving the mouse away will hide the popup.  To keep the popup, click on the button folder.

Once a popup toolbar is visible, you can click on the button just like normal.  Hovering over a button works as well.

Settings page

  • Toolbar Functionality enabled/disabled
  • Enable/disable Menu popup on mouseover for toolbar button folders
  • Enable/disable popup menu in Editor
  • Configurable time for hover menus

If popup menu in editor is disabled, then right-click on button brings it up

The settings page is accessed using the standard KSP settings page.

Known Issues

  • It rarely generates nullrefs at times, mostly harmless
  • When using the Mod Filter, if you exit the editor and then go back in, the filter won't be active UNTIL you show the filter window one time
Edited by linuxgurugamer
Link to comment
Share on other sites

Be careful with the way you've implemented the perma-prune - deleting/renaming files will play havok with CKAN users (unless CKAN has changed, but last I checked it would freak out when uninstalling/updating a mod when all files it expected to be there weren't there).  You may be better off writing a LoadingSystem mod that executes after GameDatabase (or better yet, after ModuleManager) and before PartDatabase.

That being said - cool idea!

Link to comment
Share on other sites

7 hours ago, nightingale said:

Be careful with the way you've implemented the perma-prune - deleting/renaming files will play havok with CKAN users (unless CKAN has changed, but last I checked it would freak out when uninstalling/updating a mod when all files it expected to be there weren't there).  You may be better off writing a LoadingSystem mod that executes after GameDatabase (or better yet, after ModuleManager) and before PartDatabase.

That being said - cool idea!

I don't belive CKAN will have a problem with missing files, but I'll check.

That being said, your suggestion is valid, and I'd like to learn how to do that.

Edit:  I just permapruned some parts, and then removed the mod with CKAN, no problems

Edited by linuxgurugamer
Link to comment
Share on other sites

9 hours ago, nightingale said:

Be careful with the way you've implemented the perma-prune - deleting/renaming files will play havok with CKAN users (unless CKAN has changed, but last I checked it would freak out when uninstalling/updating a mod when all files it expected to be there weren't there).  You may be better off writing a LoadingSystem mod that executes after GameDatabase (or better yet, after ModuleManager) and before PartDatabase.

That being said - cool idea!

Also for stock parts, if you use Steam and "verify local data" after pruning parts, Steam may put them back. It also may leave the pruned copies there. At the very least you (@linuxgurugamer not nightingale :wink:) should try to error out gracefully when you get in this situation, possibly notifying the player of the likely cause. I can imagine people reporting "I keep deleting this part and it keeps coming back!" a lot :) 

This would also likely happen after any update through Steam or through the new-and-improved-hopefully Launcher.

Edited by 5thHorseman
Link to comment
Share on other sites

14 minutes ago, 5thHorseman said:

Also for stock parts, if you use Steam and "verify local data" after pruning parts, Steam may put them back. It also may leave the pruned copies there. At the very least you (@linuxgurugamer not nightingale :wink:) should try to error out gracefully when you get in this situation, possibly notifying the player of the likely cause. I can imagine people reporting "I keep deleting this part and it keeps coming back!" a lot :) 

This would also likely happen after any update through Steam or through the new-and-improved-hopefully Launcher.

I know.  I actually don't recommend using the PermaPruner, the load time (unless you delete a LOT of parts) won't be impacted that much if you only block them from displaying.

The way it's written, when a part is blocked and PermaPruned, it remains in the block list, so even if Steam restores it, you won't see it;  it will load but not be visible (unless you unblock everything)

2 hours ago, Torih said:

Got a slight issue, blocked a few items using "all", then went to permaprune. the window appeared and renamed 1 of the 10ish I had selected then just threw and error in the log.

https://dl.dropboxusercontent.com/u/26687/output_log.txt

It is removing them from the VAB just seems to be an issue renaming.

I fixed that this morning, please download version 0.0.3

 

Link to comment
Share on other sites

Nice to see you got this done.  I will be down loading it myself.

 

As for the click through. I believe PWBFuelBalancer has some code that can help.  I just took over maintenance of it and discovered that chunk of code. I was planning on implementing that in my other mods.  Take a look.

Link to comment
Share on other sites

I am clueless in this regards, but could permaprune perhaps be done through module manager?

also, would it be possible to apply these settings per save? I might want to see RT parts in my RemoteTech save, but not in my Kareer save, for instance.

Link to comment
Share on other sites

38 minutes ago, Kerbart said:

I am clueless in this regards, but could permaprune perhaps be done through module manager?

No, but Nightingale suggested an alternative, which I'll be looking into

38 minutes ago, Kerbart said:

also, would it be possible to apply these settings per save? I might want to see RT parts in my RemoteTech save, but not in my Kareer save, for instance.

Yes.  Don't use PermaPrune.

PermaPrune is dangerous, and affects ALL saves.  If you don't use it, then anything blocked will only apply to the save you are in.

49 minutes ago, Torih said:

Ah thanks, latest off ckan was .2 earlier. May I suggest you put the latest version number in the title :)

I have 31 mods to deal with, it's too much trouble to update the title every time I update the mod.

I use the MiniAVC mod with all my mods, so if you aren't using CKAN you will get notified at game start that there is a new version.

 

1 hour ago, Papa_Joe said:

Nice to see you got this done.  I will be down loading it myself.

 

As for the click through. I believe PWBFuelBalancer has some code that can help.  I just took over maintenance of it and discovered that chunk of code. I was planning on implementing that in my other mods.  Take a look.

That's actually a pretty cool mod.  I'll be looking at the code.  Can you point me to that code? Found it

Edited by linuxgurugamer
Link to comment
Share on other sites

20 minutes ago, linuxgurugamer said:

No, but Nightingale suggested an alternative, which I'll be looking into

Yes.  Don't use PermaPrune.

PermaPrune is dangerous, and affects ALL saves.  If you don't use it, then anything blocked will only apply to the save you are in.

I have 31 mods to deal with, it's too much trouble to update the title every time I update the mod.

I use the MiniAVC mod with all my mods, so if you aren't using CKAN you will get notified at game start that there is a new version.

 

That's actually a pretty cool mod.  I'll be looking at the code.  Can you point me to that code? Found it

Look here, starting at line 132.  then look at the OnWindow method for implementation.

https://github.com/codepoetpbowden/PWBFuelBalancer/blob/master/PWBFuelBalancerAddon.cs

credit for this code is cybutek.  (noted in the source) :)  It goes back a ways...

 

Lol, I see I was too late :) 

Edited by Papa_Joe
Link to comment
Share on other sites

4 hours ago, Papa_Joe said:

Look here, starting at line 132.  then look at the OnWindow method for implementation.

https://github.com/codepoetpbowden/PWBFuelBalancer/blob/master/PWBFuelBalancerAddon.cs

credit for this code is cybutek.  (noted in the source) :)  It goes back a ways...

 

Lol, I see I was too late :) 

I think you meant to look at OnGUI, not OnWindow (putting this here for reference for other people)

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