Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 98: | Строка 98: | ||
for _, child in ipairs(children) do | for _, child in ipairs(children) do | ||
if child.id then | if child.id then | ||
-- Если элемент задан только через id, пытаемся получить полное описание | |||
local fullItem = findDataById(itemData, child.id) or child | |||
if not visited[child.id] then | if not visited[child.id] then | ||
result = result .. formatContent( | result = result .. formatContent(fullItem) | ||
end | end | ||
elseif child["!type"] == "NestedSelector" then | elseif child["!type"] == "NestedSelector" then | ||
| Строка 153: | Строка 155: | ||
if item.StorageFill and item.StorageFill.contents then | if item.StorageFill and item.StorageFill.contents then | ||
result = result .. getContentsOutput(item.StorageFill.contents) | result = result .. getContentsOutput(item.StorageFill.contents) | ||
-- Обработка EntityTableContainerFill | -- Обработка EntityTableContainerFill | ||
elseif item.EntityTableContainerFill and item.EntityTableContainerFill.containers then | elseif item.EntityTableContainerFill and item.EntityTableContainerFill.containers then | ||
| Строка 203: | Строка 206: | ||
result = result .. string.format('{{LinkСard/Сollapsible|name=Выпадают только вместе:|content=%s}}', handleAllSelector(child)) | result = result .. string.format('{{LinkСard/Сollapsible|name=Выпадают только вместе:|content=%s}}', handleAllSelector(child)) | ||
elseif child.id then | elseif child.id then | ||
result = result .. formatContent( | -- Если элемент задан только через id, ищем полное описание | ||
local fullItem = findDataById(itemData, child.id) or child | |||
result = result .. formatContent(fullItem) | |||
else | else | ||
result = result .. "<div>Ошибка: отсутствует id у элемента.</div>" | result = result .. "<div>Ошибка: отсутствует id у элемента.</div>" | ||