Jump to content

[0.24] Part Groups & Filter


moribundus

Recommended Posts

Simple plugin for filtering of parts in VAB/SPH.

2013061000002.jpg

Hello folks, I made this little plugin for filtering editor parts. Filtering works via text input and/or via user-defined categories and groups.

These are defined manually by user (using the provided editor). I originally wanted to define the metrics on the fly, but I couldn't find any reliable way to make it work, so I opted for this approach instead. It takes some time to properly prepare all the groups, but at least you have full control over the filtering.

Installation:

Simply extract the archive into the GameData folder.

How to use:

Type text into the text box on the upper panel to filter parts by pattern matching (name, manufacturer, description).

The "..." button toggles the group filtering window. This window shows part groups sorted into categories (columns). User can select multiple groups among multiple categories, the result filter is union/intersection of selected groups, e.g. all stock parts AND (engines OR fuel tanks). Drag the window title to move, drag the bottom right corner to resize.

Groups and categories can be modified using the provided editor, which could be found at PartGroupsFilter\Tools\PartGroupsEditor.exe (requires .NET 4.0). You can define/change existing categories by right clicking on the right panel and add parts to them by dragging from the left panel. Don't forget to save.

To disable this feature, simply delete the PartGroupsFilter\Plugins\PluginData folder. This also hides the "..." button, so you're effectively left with just the text filter.

Positioning conflicts with other plugins can be resolved by editing the PartGroupsFilter\Plugins\PluginData\config.xml file, look for filterTop, filterLeft and filterWidth variables.

Changelog:

v0.5

- KSP 0.23 compatibility fix

v0.4

- fixed compatibility issues with other plugins

v0.3

- editor improvements:

- fixed part loading issue: now loading all *.cfg files

- columns can be toggled from the View menu

- filtering using path

- log can be copied using context menu

v0.2

- fixed issue with filter being removed when loading a rocket

- positioning is now tweakable using the config.xml file

v0.1

- initial release

Links:

Plugin is uploaded at Kerbal SpacePort.

Part Groups & Filter v0.5

Temporary location: https://drive.google.com/file/d/0B82EGaR6GNXeRVFqMVpvN19sNlk/edit?usp=sharing

License: GPL3

Edited by moribundus
just found out that spaceport is down...
Link to comment
Share on other sites

I think I could move the subassembly loader button a little bit to the right (the 0.20 versin is just a hotfix anyway) and/or add configuration options to change the placement of the search bar. I'll get to it later today.

Link to comment
Share on other sites

  • 2 weeks later...

Great plugin! Should be stock, so mod addicts like me dont spend have of their time looking for this one part :-)

I found a problem with the partgroups-editor though. It doesnt list all of the B9 Aerospace parts, so I cant assign all of them into their own category. This is probably related to the search algorithm of the tool. B9's models are not always called model.mu plus there seems to be more than one part per folder multiple times. I hope that you will fix this. :-)

Link to comment
Share on other sites

Hmm, interesting. I use KW Rocketry myself and I don't have any problems with it. Which version do you use? The editor is essentially just searching for part.cfg files and then tries to parse them, so the problem could be in the parsing algorithm.

Also, could you check the log in the editor (it's from menu View->Log) if it contains any errors? I'll download B9 and try to reproduce the problem.

Link to comment
Share on other sites

KW works fine for me.

Regarding the B9 pack, the issue is that B9 was optimized using the new .20 part system in order to reduce memory usage etc.

A folder might contain more than one .cfg for different parts (because they use the same model, but have different dimensions).

These .cfg files all have different names, e.g. A.cfg, B.cfg, C.cfg.

Maybe you could simply check all .cfg files in the GameData Folder and search for the respective line to grab the part name?

Link to comment
Share on other sites

I LOVE this mod.

I use far too many items, and this mod fixes most of the problems this brings.

YES, you need to categorize the items for this to work perfectly, but it takes a few minutes and it is worth it.

I only wish all parts were required by default to have sub-categories (think engine>lliquidfuel>2.5M>blablaliquidengine) in the part files, so you could just use this mod without inputting it.

If I may: I notice that some parts are not found, mostly the ones that are in the old parts folder, and not in gamedata (although some are missing there too)

Nice work.

Reply to post above:

Essentially, I just sort parts by root directory.

This is a good idea, but it requires all mods and official releases to implement the same structure.

I would think that using a standardized approach to the part files as I suggested in this post would be ideal, as it would eliminate all variables.

Edited by RHodeidra
Link to comment
Share on other sites

Hello, apologies for the slight delay, but the next version is finally here :)

The part loading issue is hopefully fixed. The editor is now looking basically for any cfg file.

The editor itself got also quite a few improvements:

- columns in the left pannel can be hidden/revealed from the View menu

- there's a handy tooltip now that makes it much easier to read part descriptions.

- parts are also filtered by a path to the cfg file (which now occupies a new column)

- log can be copied into clipboard via context menu (was kinda useless before)

I hope there no other issues (I'm don't have much time to play KSP now, so I cannot test it as much as I should).

I didn't change the in-game filtering algorithm though (e.g. to filter by plugin as was suggested here), because the main idea was to have the text filter based on what is available in game when hovering over part (so that user can easily figure out why a certain part has been selected). In case you were wondering :)

So thanks for the feedback and have fun.

Link to comment
Share on other sites

  • 2 weeks later...

Great Plugin, thank you so much!

Wishlist for future versions:

- activating a filter (text or group) should fetch matching parts from all main categories (Pod/Engines/etc), so that i can find whatever i am looking for without having to select the correct master category

- hotkey to activate text search

- hotkey to clear all filters (group and text)

- Single-Click exclusive selection: Strg+Click or Right-Click on a group filter name additionally deactivates all other group filters from that category

Link to comment
Share on other sites

Also, this mod is unfortunately incompatible with the Subassembly Manager plugin (Subassembly Save/Load button does not show up). Any ideas here?

I can confirm this, removing "Part Group & Filter" from the plugins fixes the issue (with nothing else changed).

I have one more problem: The "..." button is missing. I haven't removed all plugins, to test this, but I've tried without Subassembly Manager, which made no difference (so it's not that they're blocking each other somehow).

Edit: I've checked without any active plugins except this, and the "..." button is still missing. So it isn't even any interaction with other mods.

Edited by Creat
Link to comment
Share on other sites

The "..." button disappears automatically if there are no applicable filter groups -- either the configuration was deleted, or all the defined groups are "empty". The same behaviour applies for groups in filter window, example: you define groups for KW Rocketry. Then you uninstall KW rocketry and those groups disappear from the UI. And if there are no groups at all, then the "..." button disappears as well. So I would check if the configuration is ok, esp. if you moved some files around.

Regarding the subassembly manager...I was looking into it and it seems it's an actually a bug (or a feature of KSP) and affects also other plugins (tested also with Jeb's toolbox). The problem? It seems that from all plugins, that are declared as


[KSPAddon(KSPAddon.Startup.Editor, true)]
public class FooBar : MonoBehaviour { ... }

only one is actually initialized. I changed it to Startup.MainMenu and it seems to work. However the question is if this actually solve anything or if it will just transform the problem (of all the plugins declared to be created in the main menu, only one is chosen). I'll try to test more and hopefully publish a fix during this weekend.

Edited by moribundus
Link to comment
Share on other sites

Awesome, thanks. That was the problem, it seems. I used fix based on MrShifty's code in the end, but at least it gave me some insight into what was going on. Anyway, the new version is up :)

Btw. if you use TAB you can cycle various active inputs in the game, you can use that to get activate the text search without using mouse. It also selects the current text, so you can just start typing.

Edited by moribundus
Link to comment
Share on other sites

  • 3 months later...

Is it dead? I really like to have a searchbar.

Edit: Is not really working anymore because recently it hides partly under PartCatalog and can't be moved (I was editing the cfg which seems now to have no effect for some reason)

Edited by Bizz Keryear
Link to comment
Share on other sites

  • 2 weeks later...

Hello, it is not dead, I just don't play KSP as often these days and the plugin is working for me quite fine (I don't use other UI mods though).

I'll check what's wrong with the XML.

Edit: Everything seems to work for me. Make sure you are editing the right part of the config file.

Edited by moribundus
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...
  • 4 months later...
  • 2 weeks later...
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...