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

мНет описания правки
мНет описания правки
Строка 69: Строка 69:
     if not item then return '' end
     if not item then return '' end


local result = ''
     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)
Строка 101: Строка 102:
end
end


-- Основная функция модуля
-- Основная функция модуля
-- Основная функция модуля
function p.main(frame)
function p.main(frame)
Строка 111: Строка 113:
     if not data then return 'Не удалось загрузить данные.' end
     if not data then return 'Не удалось загрузить данные.' end


     -- Проверка на framing
     -- При режиме framing
     if mode == 'framing' then
     if mode == 'framing' then
         local subMode = frame.args[3]
         local subMode = frame.args[2] -- второй параметр
        id = frame.args[2]
 
         if subMode == 'chem' then
         if subMode == 'chem' then
             return mw.getCurrentFrame():preprocess('{{СollapsibleMenu|' .. getChemOutput(data, id) .. '}}')
             return mw.getCurrentFrame():preprocess('{{СollapsibleMenu|' .. getChemOutput(data, id) .. '}}')
Строка 125: Строка 125:
     end
     end


     -- При обычном режиме, без framing
     -- При нормальном режиме
     if mode == 'chem' then
     if mode == 'chem' then
         return getChemOutput(data, id)
         return getChemOutput(data, id)