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

Post your bugs and problems so we can fix them.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 153
Joined: Tue Feb 06, 2024 5:18 am
Contact:

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

Post 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 338 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 338 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. :-)
User avatar
Osmo
Fast Inserter
Fast Inserter
Posts: 190
Joined: Wed Oct 23, 2024 12:08 pm
Contact:

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

Post by Osmo »

Does the label's style has this property set to false? https://lua-api.factorio.com/latest/cla ... ingle_line
Gweneph
Long Handed Inserter
Long Handed Inserter
Posts: 72
Joined: Thu Nov 14, 2019 11:51 pm
Contact:

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

Post 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.
User avatar
hgschmie
Fast Inserter
Fast Inserter
Posts: 153
Joined: Tue Feb 06, 2024 5:18 am
Contact:

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

Post by hgschmie »

Thanks. Appreciate you pointing those out. This is such a big API, I always learn new things.
Post Reply

Return to “Bug Reports”