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

мНет описания правки
мНет описания правки
Строка 70: Строка 70:
     if not tableData then return 'Таблица не найдена.' end
     if not tableData then return 'Таблица не найдена.' end


     local groupSelector = tableData['!type:GroupSelector']
     if tableData['!type:GroupSelector'] and tableData['!type:GroupSelector'].children then
    if groupSelector and groupSelector.children then
         local result = ''
         local result = ''
         local groupSelectors = {}
         local groupSelectors = {}


         -- Группируем элементы по weight
         -- Группируем элементы по weight
         for _, child in ipairs(groupSelector.children) do
         for _, child in ipairs(tableData['!type:GroupSelector'].children) do
             if child["!type"] == "GroupSelector" then
             if child["!type"] == "GroupSelector" then
                 local weight = child.weight or "default"
                 local weight = child.weight or "default"
Строка 94: Строка 93:


         return result
         return result
     elseif tableData['!type:NestedSelector'] and tableData.children then
     elseif tableData['!type:AllSelector'] and tableData['!type:AllSelector'].children then
         return processNestedSelectors(tableData.children)
         return processNestedSelectors(tableData['!type:AllSelector'].children)
    else
        return 'Таблица не содержит элементов.'
     end
     end
    return 'Таблица не содержит элементов.'
end
end