Модуль:ArmorStats: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 12: | Строка 12: | ||
function p.templateCells(frame) | function p.templateCells(frame) | ||
local anchorName = frame.args.anchorName or "" -- Название якоря | local anchorName = frame.args.anchorName or "" -- Название якоря | ||
local image = frame.args.image or "" -- Путь к изображению предмета | local image = frame.args.image or "" -- Путь к изображению предмета | ||
local itemId = frame.args.itemId or "" -- ID предмета | local itemId = frame.args.itemId or "" -- ID предмета | ||
local color = frame.args.color or "" -- Цвет фона первой ячейки | |||
local backgroundColor = frame.args.backgroundColor or "" -- Цвет фона для всех ячеек, кроме первой | |||
local class = frame.args.class or "" -- Класс | |||
local protBlunt = frame.args.protBlunt or "-" -- Ударный | local protBlunt = frame.args.protBlunt or "-" -- Ударный | ||
local protSlash = frame.args.protSlash or "-" -- Режущий | local protSlash = frame.args.protSlash or "-" -- Режущий | ||
| Строка 24: | Строка 26: | ||
local protCaustic = frame.args.protCaustic or "-" -- Радиационный | local protCaustic = frame.args.protCaustic or "-" -- Радиационный | ||
local protExplosion = frame.args.protExplosion or "-" -- Взрывной | local protExplosion = frame.args.protExplosion or "-" -- Взрывной | ||
local description = frame.args.description or "" -- Описание | local description = frame.args.description or "" -- Описание | ||
local location = frame.args.location or "" -- Местонахождение | local location = frame.args.location or "" -- Местонахождение | ||
-- Вызов функции из модуля Entity Lookup для создания image tooltip | -- Вызов функции из модуля Entity Lookup для создания image tooltip | ||
| Строка 56: | Строка 57: | ||
out = out .. '|style="background-color: ' .. backgroundColor .. '"|\n' .. location .. '\n|-' | out = out .. '|style="background-color: ' .. backgroundColor .. '"|\n' .. location .. '\n|-' | ||
return | -- Обертывание результата в div с заданным классом | ||
local result = '<div class="' .. class .. '">' .. out .. '</div>' | |||
return result | |||
end | end | ||
return p | return p | ||