ToolTipFix

ToolTipFix

4M Downloads

Tooltips replaces colors with alternates.

Kichura opened this issue · 5 comments

commented

Usually the mod should just make the text italic or create a new line for either bold or normal text, But for some reason it affects colors and causes them to change when the window size does not have enough room to fit.

Expected behavior:
image

Actual behavior:
image

commented

Can confirm. Italic and purple is the default style for item lores, so it looks like it resets the style when wrapping.

commented

Fun fact: if you style the tooltip text inside of the translation using §5§o, it breaks even worse! The text loses its color when it breaks down to another line.

commented

ToolTipFix has never properly handled styles correctly. Currently it just copies the style of the previous line when making a new line. Not sure how it's ending up purple/italic though.

I do plan on fixing this eventually

commented

This is still an issue and it's quite annoying. The issue here are ChatFormatting codes. ToolTipFix prefers the Component's Style over those, but for Minecraft it's the other way around: If a String contains ChatFormatting codes, the set Style is (mostly?) ignored in favor of the custom formatting.

In the attached screenshot from a mod of mine (feel free to use it for testing a fix, the mod allows for using formatting codes directly in the anvil text field) you can see how formatting codes are properly applied in the first line, and then as mentioned in another comment, the Component's Style is used instead for the following lines.

This is not an issue in the native fix Forge has, so maybe it's worth checking that out.

2022-10-03_16 22 52

commented

Been a while, I apologize for the delay.

TooltTipFix 1.1.0 is almost a complete rewrite of the wrapping logic significantly improving it. I believe this issue is fixed.