Page 1 of 1

[2.0.10] Localisation built-in parameter __CONTROL__name__ doesn't accept __1__ anymore

Posted: Thu Oct 24, 2024 5:01 pm
by ickputzdirwech
It used to be possible to use a parameter inside built-in parameters.

For example I generate custom inputs for a bunch of shortcuts and append them to the name of the shortcut:

Code: Select all

local shortcuts = {
	"draw-grid"
}
for _, name in pairs(shortcuts) do
	if data.raw.shortcut[name] then
		data:extend({{
			type = "custom-input",
			name = data.raw.shortcut[name].name,
			localised_name = data.raw.shortcut[name].localised_name,
			order = data.raw.shortcut[name].order,
			key_sequence = ""
		}})
		data.raw.shortcut[name].localised_name = {"", data.raw.shortcut[name].localised_name, " ", {"Shortcuts-ick.control", name}}
	end
end
In the .cfg I have the following:

Code: Select all

[Shortcuts-ick]
control=(__CONTROL____1____)
It used to result in a localised name like "Grid (not set)" but now returns "Grid __CONTROL__1__" instead. (Note that it has only two underscores before and after the "1")

Re: [2.0.10] Localisation built-in parameter __CONTROL__name__ doesn't accept __1__ anymore

Posted: Thu Oct 24, 2024 5:08 pm
by Genhis
Thanks for the report, this works as intended. Parameters are now processed in one pass.