Page 1 of 1

[0.16.51] Item descriptions in tooltips should linewrap.

Posted: Thu Nov 01, 2018 9:18 am
by eradicator
What?
Item descriptions for (some?) items do not linewrap.

My mod quickprint adds a new blueprint prototype with a longish description:
longtip.png
longtip.png (192.95 KiB) Viewed 1406 times

⇒ I can "fix" this by adding some manual linebreaks...

Code: Select all

[item-description]
er-quickprint=Blueprint that automatically resets itself after use.\nCan be customized with mod settings.\nPress __CONTROL__er-quickprint:copy-to-blueprint__ while holding it to get a standard blueprint copy.
manualtooltip.png
manualtooltip.png (132.57 KiB) Viewed 1406 times

⇒ But vanilla items seem to automatically linebreak...

cctooltip.png
cctooltip.png (114.84 KiB) Viewed 1406 times

Re: [0.16.51] Item descriptions in tooltips should linewrap.

Posted: Sat Nov 03, 2018 7:37 pm
by Therax
I'm going to guess that this is specific to blueprint items, because blueprint tooltips may need extremely large widths to hold the preview image.

Re: [0.16.51] Item descriptions in tooltips should linewrap.

Posted: Fri Nov 09, 2018 10:56 am
by Rseding91
Therax wrote: Sat Nov 03, 2018 7:37 pm I'm going to guess that this is specific to blueprint items, because blueprint tooltips may need extremely large widths to hold the preview image.
Correct. In order to line-wrap there needs to be some "max width after which text is line-wrapped" and because the blueprint tooltip max width is the screen width it doesn't wrap.

Re: [0.16.51] Item descriptions in tooltips should linewrap.

Posted: Fri Nov 09, 2018 11:11 am
by eradicator
Rseding91 wrote: Fri Nov 09, 2018 10:56 am
Therax wrote: Sat Nov 03, 2018 7:37 pm I'm going to guess that this is specific to blueprint items, because blueprint tooltips may need extremely large widths to hold the preview image.
Correct. In order to line-wrap there needs to be some "max width after which text is line-wrapped" and because the blueprint tooltip max width is the screen width it doesn't wrap.
Would it be possible to diffrenciate between an empty and a setup blueprint? (Assuming that detecting the actual length of a setup blueprint before setting the size won't happen?)