Модуль:Prototypes/Хранилище/Предмет: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 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 | ||
if mode == 'framing' then | if mode == 'framing' then | ||
local subMode | local subMode = 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 | ||
-- При | -- При нормальном режиме | ||
if mode == 'chem' then | if mode == 'chem' then | ||
return getChemOutput(data, id) | return getChemOutput(data, id) | ||