Page 1 of 1

[2.0.71] Rich Text line breaks in LocalisedStrings (label caption)

Posted: Tue Oct 21, 2025 4:41 am
by hgschmie
I have a localised string that looks like this: open_gui_shift=Open GUI\n[font=default-semibold][color=128,206,240]Shift:[/color][/font] Open location on map

When I use this text as a tooltip, it renders like this:

Screenshot 2025-10-20 at 21.33.25.png
Screenshot 2025-10-20 at 21.33.25.png (15.54 KiB) Viewed 349 times

but when I use it as a caption for a label, it renders like this:

Screenshot 2025-10-20 at 21.35.12.png
Screenshot 2025-10-20 at 21.35.12.png (11.29 KiB) Viewed 349 times

and I have not found a way to make that caption to render the line break correctly. I found a bunch of messages from the 0.15 era that says "text barely works, no new lines supported". Is that still the case? If yes, consider this a feature request. :-)

Re: [2.0.71] Rich Text line breaks in LocalisedStrings (label caption)

Posted: Tue Oct 21, 2025 6:23 am
by Osmo
Does the label's style has this property set to false? https://lua-api.factorio.com/latest/cla ... ingle_line

Re: [2.0.71] Rich Text line breaks in LocalisedStrings (label caption)

Posted: Thu Oct 30, 2025 10:22 pm
by Gweneph
unrelated to the maybe formatting bug, but you might be interested in __CONTROL_MODIFIER__name__ instead of hard-coding shift. And/or __CONTROL_STYLE_BEGIN__ and __CONTROL_STYLE_END__ instead of the font and color.

Re: [2.0.71] Rich Text line breaks in LocalisedStrings (label caption)

Posted: Sat Nov 01, 2025 5:18 pm
by hgschmie
Thanks. Appreciate you pointing those out. This is such a big API, I always learn new things.