KSPModdingLibs / KSPCommunityFixes

Community patches for bugs in the KSP codebase
49 stars 17 forks source link

Search in the Part Editor of parts with none category #234

Open yalov opened 3 months ago

yalov commented 3 months ago

The known feature is that if the category is none, than a part is hidden from the parts search.

As I understand, an asteroid part or a kerbal part have a category equal to none and therefore cannot be searchable — that is good.

A problem is a conflict with "Community Category Kit" mechanic, what is getting worse with the Community Parts Titles Extras: CCK - No Duplicates — in this scenario, a part could be in the cck category, but be hidden from the stock category (has category set to none), and therefore not searchable.

One of the solution would be to search all parts, but hardcode exclude kerbals, asteroid and comet. I am not familiar with other "special" parts (stock or mods) that need to be exluded.

nagleaidan commented 3 months ago

That sounds like a problem for CCK to fix, not this mod

yalov commented 3 months ago

The default behavior of disabling search for parts with no category is questionable and generally unexpected.

I believe parts should remain searchable even if they are hidden from all categories, whether intentionally or unintentionally, in the simple (one-column) view in the editor.

Rodg88 commented 3 months ago

Having category = none is actually used to specifically hide parts in some cases, particularly when soft-deprecating parts to prevent their use without outright deleting them.

nagleaidan commented 3 months ago

The default behavior of disabling search for parts with no category is questionable and generally unexpected.

It's not an unexpected behavior if you're playing stock or with most mods (CCK being a notable exception). I don't want to search and see deprecated parts or asteroids or Jeb's Workshop (a JNSQ Easter egg).

I believe parts should remain searchable even if they are hidden from all categories, whether intentionally or unintentionally, in the simple (one-column) view in the editor.

This is a feature, you may disagree with it but it's still a feature. Community Fixes is designed for fixing bugs, not altering features. If you want to change this feature, make a separate mod.

yalov commented 3 months ago

I agree that CCK itself would be a better place for this setting — but that will never happen. And CCK is very popular, based on CKAN download count.

Also I would add the full search in the "Community Parts Titles Extras: CCK - No Duplicates" if I would know how to work with Harmony.

Maybe It could be a KSPCommunityFixes setting, disabled by default, what could enable search for everything, even for asteroid, kerbalEVA, and soft-deprecating parts?

I still prefer to have several deprecated parts in the search results rather than be unable to find a properly loaded part due to some CCK-related patch incompatibility.

JonnyOThan commented 3 months ago

I still prefer to have several deprecated parts in the search results rather than be unable to find a properly loaded part due to some CCK-related patch incompatibility.

Isn’t this solvable with a simple MM patch that changes the category of all parts that have it set to none?

yalov commented 3 months ago

Isn’t this solvable with a simple MM patch that changes the category of all parts that have it set to none

No, setting @category = anything_else with KSPCF makes a part load into the default category, which is fuel tanks. Without KSPCF, it doesn't load at all, so @category = anything_else does not work either.

yalov commented 3 months ago

Is it within the scope to create a new "hidden" enum that is hidden and does not appear as a category in the GUI?

if it will be also default (https://github.com/KSPModdingLibs/KSPCommunityFixes/issues/159), then failed to load without KSPCF parts will be able to load, but will be not appearing in the Fiel Tanks category.