[Genhis] [1.1.73] Locale fallback groups do not work on captions or tooltips set after creation

This subforum contains all the issues which we already resolved.
User avatar
raiguard
Factorio Staff
Factorio Staff
Posts: 580
Joined: Wed Dec 13, 2017 8:29 pm
Contact:

[Genhis] [1.1.73] Locale fallback groups do not work on captions or tooltips set after creation

Post by raiguard »

If you create a GUI element, then later change its caption or tooltip, locale fallback groups are not parsed. They only work when setting the caption or tooltip on initial creation of the GUI element.

To reproduce:
Run this command:

Code: Select all

/c game.player.gui.top.add{type = "button", caption = {"?", {"item-name.ice-cream"}, "no ice cream"}} game.player.gui.top.add{type = "button", name = "test"} game.player.gui.top.test.caption = {"?", {"item-name.ice-cream"}, "no ice cream"}
The first button will correctly show no ice cream, but the second button will show Unknown key: "?".
Don't forget, you're here forever.
Honktown
Smart Inserter
Smart Inserter
Posts: 1042
Joined: Thu Oct 03, 2019 7:10 am
Contact:

Re: [Genhis] [1.1.73] Locale fallback groups do not work on captions or tooltips set after creation

Post by Honktown »

Adding: it also doesn't work in just game.print:

Code: Select all

/c game.print({"?",{"item-name.ice-cream"},"no ice cream"})
I have mods! I guess!
Link
User avatar
jan1i3
Long Handed Inserter
Long Handed Inserter
Posts: 59
Joined: Sun Dec 09, 2018 1:36 pm
Contact:

Re: [Genhis] [1.1.73] Locale fallback groups do not work on captions or tooltips set after creation

Post by jan1i3 »

Based on this I recognize a pattern that is probably relevant: in LuaGuiElement.add the entire structure gets converted to a PropertyTree first, including the localised string. Assigning to LuaGuiElement.caption doesn't do that, neither does game.print, neither do most things (edit: that take localised strings), so these are most likely 2 different parse functions.
Also known as JanSharp. jan1i3 was/is my old name ;)
Genhis
Factorio Staff
Factorio Staff
Posts: 682
Joined: Wed Dec 24, 2014 8:19 am
Contact:

Re: [Genhis] [1.1.73] Locale fallback groups do not work on captions or tooltips set after creation

Post by Genhis »

Thanks for the report. This and other issues with fallback group parsing are fixed for the next release.
Post Reply

Return to “Resolved Problems and Bugs”