Модуль:Prototypes/Хранилище/Предмет: различия между версиями

мНет описания правки
мНет описания правки
Строка 80: Строка 80:


     local result = ''
     local result = ''
    -- Обработка StorageFill внутри контейнеров
     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)
     elseif item.EntityTableContainerFill and item.EntityTableContainerFill.containers then
     elseif item.EntityTableContainerFill and item.EntityTableContainerFill.containers then
         local containers = item.EntityTableContainerFill.containers
         local containers = item.EntityTableContainerFill.containers
        local tableId = containers.storagebase and containers.storagebase.tableId
                        or containers.entity_storage and containers.entity_storage.tableId
                        or containers.other_storage and containers.other_storage.tableId
        if tableId then
            result = result .. getTableOutput(tableId)
        else
            result = result .. 'Таблица не найдена.'
        end
        -- Обработка GroupSelector внутри контейнеров
         if containers.entity_storage then
         if containers.entity_storage then
             for _, child in ipairs(containers.entity_storage.children) do
             local tableId = containers.entity_storage.tableId
                if child["!type"] == "GroupSelector" then
            if tableId then
                    result = result .. '<div class="test">'
                result = result .. getTableOutput(tableId)
                    result = result .. getContentsOutput(child.children)
            else
                    result = result .. '</div>'
                for _, child in ipairs(containers.entity_storage.children) do
                    if child.id then
                        result = result .. formatContent(child)
                    elseif child["!type"] == "GroupSelector" then
                        result = result .. '<div class="together">'
                        result = result .. getContentsOutput(child.children)
                        result = result .. '</div>'
                    end
                 end
                 end
             end
             end
Строка 109: Строка 104:
     return result
     return result
end
end


-- Формирование списка химии
-- Формирование списка химии