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

мНет описания правки
мНет описания правки
Строка 79: Строка 79:
                 local weight = child.weight or "default"
                 local weight = child.weight or "default"
                 groupSelectors[weight] = groupSelectors[weight] or {}
                 groupSelectors[weight] = groupSelectors[weight] or {}
                 table.insert(groupSelectors[weight], child.children)
                 for _, subChild in ipairs(child.children) do
                    table.insert(groupSelectors[weight], subChild)
                end
            elseif child.id then
                -- Если это просто элемент с id
                result = result .. formatContent(child)
             end
             end
         end
         end
Строка 86: Строка 91:
         for weight, groups in pairs(groupSelectors) do
         for weight, groups in pairs(groupSelectors) do
             result = result .. string.format('<div class="together" id="%s">', weight)
             result = result .. string.format('<div class="together" id="%s">', weight)
             for _, group in ipairs(groups) do
             result = result .. getContentsOutput(groups)
                result = result .. getContentsOutput(group)
            end
             result = result .. '</div>'
             result = result .. '</div>'
         end
         end