Модуль:tableofchemicals
| Строка 52: | Строка 52: | ||
local substanceName = "" | local substanceName = "" | ||
local color = "" | |||
local textColor = "" | |||
if firstProductId and p.chem[firstProductId] then | if firstProductId and p.chem[firstProductId] then | ||
substanceName = p.chem[firstProductId].name or firstProductId | substanceName = p.chem[firstProductId].name or firstProductId | ||
color = p.chem[firstProductId].color or "" | |||
textColor = p.chem[firstProductId].textColor or "" | |||
end | end | ||
templateArgs.substance = substanceName | templateArgs.substance = substanceName | ||
templateArgs.color = color | |||
templateArgs.textColor = textColor | |||
local template = "Строка_реакции" | local template = "Строка_реакции" | ||
| Строка 211: | Строка 217: | ||
local actions = {} | local actions = {} | ||
for _, mixingCategory in pairs(reactPrototype.mixingCategories) do | if reactPrototype.mixingCategories and type(reactPrototype.mixingCategories) == "table" then | ||
for _, mixingCategory in pairs(reactPrototype.mixingCategories) do | |||
local image = getMixingImage(mixingCategory.id) | |||
if image ~= nil then | |||
table.insert(actions, string.format("[[File:%s|32px|link=]]", image)) -- Картинка | |||
end | |||
table.insert(actions, mixingCategory.name or mixingCategory.id) -- Название | |||
end | end | ||
end | end | ||