Модуль:Prototypes/Хранилище/Предмет: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 297: | Строка 297: | ||
end | end | ||
local | local function processSolution(solution) | ||
local output = "" | |||
return | if solution and solution.reagents then | ||
for _, reagent in ipairs(solution.reagents) do | |||
local chemInfo = chemTranslateData[reagent.ReagentId] | |||
local displayName = chemInfo and chemInfo.name or reagent.ReagentId | |||
output = output .. string.format( | |||
'<li>[[Химия#chem_%s|%s]] (%d ед.)</li>', | |||
reagent.ReagentId, displayName, reagent.Quantity | |||
) | |||
end | |||
end | |||
return output | |||
end | end | ||
local result = "" | local result = "" | ||
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 | ||