[#1411] Show combined mass of multi-selection hover in component #1412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fixes #1411. I’ve made it so that the name just displays ‘Components ’, with all the names of the selected components as a description (second line) in the hover box. If the component selection contains a component with children, it will also give the total mass of that parent component, just as is now the case if you hover over the body tube in ‘A simple model rocket’. For instance if you select the nose cone and body tube in ‘A simple model rocket’, it will display ‘Components (28.5 g of 48.1 g total)’. If no parent components are present, it just shows ‘Components (28.5 g)’. Another special case is if you select a stage or rocket (together with other components). In that case it just shows ‘Components ()’, but with the sustainer and all other components included in the hover description.
(I decided the first line just needs to say ‘Components’ instead of the full list of components, because otherwise you would have to pass your focus all the way to the end of the hover box to finally see the actual mass. The component list is also not really important, that’s why it’s just on the description line.
Anyway too much talking from me, here’s a demo to make it all clear:
Screen.Recording.2022-06-07.at.15.22.49.mp4
Here is a jar file for testing.