Модуль:TableOfChemicals: различия между версиями
мНет описания правки |
мНет описания правки |
||
| Строка 9: | Строка 9: | ||
local out = "" | local out = "" | ||
local group = frame.args.group | local group = frame.args.group | ||
local additional = frame.args.additional | |||
if additional ~= nil then | |||
local additionalChemPrototypeIds = mw.text.split(additional, ",") | |||
for _, chemPrototypeId in pairs(additionalChemPrototypeIds) do | |||
out = out .. fillChemistryRow(chemPrototypeId) | |||
end | |||
end | |||
for _, chemPrototype in pairs(p.chem) do | for _, chemPrototype in pairs(p.chem) do | ||
if group == nil or group == "all" or chemPrototype.group == group then | if group == nil or group == "all" or chemPrototype.group == group then | ||
out = out .. fillChemistryRow(chemPrototype.id) | |||
end | end | ||
end | end | ||
| Строка 28: | Строка 36: | ||
fillChemistryRow = function(chemPrototypeId) | fillChemistryRow = function(chemPrototypeId) | ||
local out = "" | |||
local chemPrototype = p.chem[chemPrototypeId] -- Считаем что id совпадает с ключем p.chem | local chemPrototype = p.chem[chemPrototypeId] -- Считаем что id совпадает с ключем p.chem | ||
local templateArgs = {} | local templateArgs = {} | ||
| Строка 83: | Строка 92: | ||
end | end | ||
end | end | ||
return out | |||
end | end | ||