KSPModdingLibs / KSPCommunityFixes

Community patches for bugs in the KSP codebase.
https://github.com/KSPModdingLibs/KSPCommunityFixes/releases/latest
57 stars 20 forks source link

`PartIcon` fixes and customization #37

Open gotmachine opened 2 years ago

gotmachine commented 2 years ago

Basically reproduce what this old mod does :

Could be implemented as a PartLoader.CreatePartIcon() replacement.

StoneBlue commented 2 years ago

Thanx for even considering adding it. ;)

StoneBlue commented 2 years ago

Related, seemingly a stock bug (?)... When you first enter one of the editors, the part icons do also rotate in the larger icon thumb, when you do hover-over to expand the part info window.... But after switching tabs/pages... Soon all the larger thumbs in the part info window stop rotating. I get this without Part Icon Fixer installed, and seems to be a stock bug? vOv Leaving the editor scene to another, then going back to an editor scene, seems to reset it, so they initially go bac to rotating...but, again, only till you switch pages or tabs EDIT: yeah, just confirmed this in a fresh, stock-only install... Does seem to take longer switching tabs/hovering over moar parts, before it starts happening tho... vOv

gotmachine commented 2 years ago

I think I've seen that happen too, but I can't reproduce it right now. If you manage to get repeatable reproduction steps, that would help, this kind of random issues is really hard to track down...

StoneBlue commented 2 years ago

So, I installed a fresh install... not a single mod installed... Start the game, go into one of the editors... Default tab is the Command parts... DO NOT SELECT ANYTHING! Go to another tab, and the icons in the extra info window no longer rotate. The trigger seems to be, whether you actually place a command part, before switching to another tab (catagory) of parts. It may take quite a number of times hovering over random parts, and/or switching tabs, but eventually, the icons will stop rotating.

Also, if you do pick a command part as first part, and before switching tabs, and build a craft, then decide to start over, if you grab the vessel, dump it back into the parts page, all the icons stop rotating.

You can reset it, by exiting to the Space center, then re-entering one of the hangars.

gotmachine commented 2 years ago

Thanks, for the repro steps, I managed to identify and fix it.

It is actually even easier than that to reproduce : go to the VAB, make sure it's empty (no part in the editor), and hover on any greyed out surface-attachable only part. Now the icons don't spin anymore.

What happens is that greyed out parts are set to not rotate, and the top level tooltip controller will be set to that state if you hover on a greyed out part, but it will never get out of that state when you hover a non-greyed out part. That's a one-line fix.

StoneBlue commented 2 years ago

Ahhhh... that makes sense. Thnx for looking into this

gotmachine commented 2 years ago

The part icon stopping spinning issue patch is included in release 1.14.0 I will keep this issue open for the other stuff, in case me or someone want to work on it.