Extra Alchemy

Extra Alchemy

13M Downloads

Tooltip is too long

gralp-1 opened this issue ยท 3 comments

commented

Describe the bug
The tooltip for the potion ring goes off the screen

To Reproduce
Steps to reproduce the behaviour:

  1. Hover over the potion ring to show the tooltip

Expected behaviour
I think it should break into a new line

Screenshots
image

Environment (please complete the following information):

  • Mod Version: 1.4.4
  • MC Version: 1.16.5, MultiMC
  • Fabric Version: 0.11.3
  • Fabric API version: 0.32.5
  • System: Windows 10
  • Installation type: Single Player

Additional context
I think adding a \n should fix it.

commented

I've found a fix for it. just replace the tooltip.add() with this:

tooltip.add(new LiteralText("Error: rings must have exactly").formatted(Formatting.RED, Formatting.BOLD));
tooltip.add(new LiteralText("1 potion effect applied to them").formatted(Formatting.RED, Formatting.BOLD));

I tested this and got this:
image

obviously, you can change it wherever you see fit.

commented

Yes, that would be the correct way to fix it. However, I still think that would look weird if someone has a bigger screen and the tooltip just breaks in half, so I plan on letting the mod I linked in my first message do the proper line wrapping dynamically

commented

For now https://www.curseforge.com/minecraft/mc-mods/tooltipfix should do the trick.
I'll fix this eventually on the mod alone, but since it only happens on misconfigured rings this should not be a very common issue to begin with.

A newline in the tooltip should not work actually, tooltips are divided into lines by adding different objects to a list, and splitting them is not as straightforward as one would think