Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 290: | Строка 290: | ||
end | end | ||
local | local result = "" | ||
if | |||
return | local function processSolution(solution) | ||
local output = "" | |||
if solution and solution.reagents then | |||
for _, reagent in ipairs(solution.reagents) do | |||
output = output .. string.format( | |||
'<li>[[Химия#chem_%s|%s]] (%d ед.)</li>', | |||
reagent.ReagentId, reagent.ReagentId, reagent.Quantity | |||
) | |||
end | |||
end | |||
return output | |||
end | end | ||
result = result .. processSolution(item.SolutionContainerManager.solutions["food"]) | |||
result = result .. processSolution(item.SolutionContainerManager.solutions["beaker"]) | |||
return string.format('<ul class="1">%s</ul>', result) | return result ~= "" and string.format('<ul class="1">%s</ul>', result) or '' | ||
end | end | ||