linuxgurugamer

[1.5.*] End your parts list nightmare - Introducing The Janitor's Closet

Recommended Posts

Janitor's Closet

The new version for KSP 1.4.1 has new dependencies

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

 

Download from:

 

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:

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

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

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

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

exportEntry.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".:

Import.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 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
  • Like 77

Share this post


Link to post
Share on other sites

How can this only have just been done! I'm so glad it became a reality. Goodbye stock parts, I've never used you and now I wont have to look at you. Thanks so much.

  • Like 1

Share this post


Link to post
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!

Share this post


Link to post
Share on other sites

I'm jumping on the bandwagon of the above posts and declaring this to be AWESOME

 

 

Share this post


Link to post
Share on other sites

All the comments thus far sum up my appreciation for this mod idea and it's implementation.  My humble thanks.

Peace.

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
17 hours ago, SpannerMonkey(smce) said:

How can this only have just been done! I'm so glad it became a reality. Goodbye stock parts, I've never used you and now I wont have to look at you. Thanks so much.

Wow, that's harsh :P

Share this post


Link to post
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

Share this post


Link to post
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

 

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites
1 hour ago, linuxgurugamer said:

I fixed that this morning, please download version 0.0.3

 

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

Share this post


Link to post
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.

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites
1 hour ago, linuxgurugamer said:

@Papa_Joe

Thanks.

Is that mod ready for 1.1.3?

No problem!

Yes.  I'm working a couple of bugs, but it is updated for 1.1.3.  note the new thread in my sig.

Edited by Papa_Joe

Share this post


Link to post
Share on other sites
19 minutes ago, Papa_Joe said:

No problem!

Yes.  I'm working a couple of bugs, but it is updated for 1.1.3.  note the new thread in my sig.

ok, thanks.

Let me know if you need any help.

Share this post


Link to post
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)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now