Item Tooltip Sizing and Positioning
Kepler-17c opened this issue ยท 15 comments
When I halve my Minecraft window to one side of the screen (yes, I do that sometimes - don't beat me - for item management stuff where I need several things next to each other), the tooltip on some items isn't inside the game window bounds, but it pushed out to the side. It becomes unreadable when the left half of a tooltip is missing.
Can you add a screenshot of this?
I feel there's a decent chance this is just vanilla behavior
As you can see from the squares, I'm on the most recent version (90) as of now.
lol, thanks for pointing that out, it should not happen in production.๐ See #138 for tracking the issue.
That top one is definitely just vanilla behavior - it's not getting affected by the tooltip feature at all since, like the one in legacy wynntils, it only checks the vertical borders of the screen. We could maybe add checks for horizontal borders as well but that's very rarely an issue in-game
That second one is definitely strange though. My guess is that the minecraft rendering system always handles dimensions as if they're 16:9 and does some extra processing for non-standard window sizes that we're not accounting for, but I'll have to look into it further. Could you attach a full screenshot so I know just what shape your window is?
No, I mean it's already implemented - I'll have to switch versions to make sure, but as far as I remember, that broken item stopped at the side and wrapped to the next line
As you can see from the squares, I'm on the most recent version (90) as of now.
A solution for the item guesses problem would be wrapping when the text gets too long.
Yeah it might be good to consider that for 1.12.2 version. Another alternative is to further split from the four possible levels, one line for each level.
I did some testing, and it seems like this wrapping issue is only present with fabric and quilt (this is also the vanilla behavior). However with forge the wrapping works perfectly fine, the same as in 1.12.
I searched for the code making it possible in forge, but couldn't find the implementation (the method was empty).
I did some testing, and it seems like this wrapping issue is only present with fabric and quilt (this is also the vanilla behavior). However with forge the wrapping works perfectly fine, the same as in 1.12.
I searched for the code making it possible in forge, but couldn't find the implementation (the method was empty).
What was the method name? Was it not overwritten by something?
correction: turns out screen::renderComponentHoverEffect
is used when you hover over a hoverable text component. The wrapping seems to be working fine when hovering the text.
What was the method name? Was it not overwritten by something?
I did some more searching and found how forge actually does it ForgeHooksClient::gatherTooltipComponents
But I also found some code which supposedly already does this wrapping in the vanilla code (it doesn't) screen::renderComponentHoverEffect