Skyblocker icon indicating copy to clipboard operation
Skyblocker copied to clipboard

Add aligned text for tooltips to align multiple lines

Open Emirlol opened this issue 1 year ago • 2 comments

Yoinked from #786. Improved it to make it simpler to use and added some documentation.

Emirlol avatar Oct 22 '24 05:10 Emirlol

Perhaps the aligning point could be set dynamically to waste less space when the elements don't fill up the space as much. The 100 point was set based on the museum text, which can get quite long, but other lines are usually near 80 so there's a big gap between the labels and the values. This would also fix potential issues with lines longer than 100px if any such line gets added in the future.

Emirlol avatar Oct 22 '24 05:10 Emirlol

Currently breaks tooltips on REI due to REI handling tooltip component creation manually: https://github.com/shedaniel/RoughlyEnoughItems/blob/eaf9236e3da2adafcea204778ecc0072e70d0aa5/fabric/src/main/java/me/shedaniel/rei/impl/client/gui/fabric/ScreenOverlayImplFabric.java#L53

Emirlol avatar Oct 22 '24 08:10 Emirlol