Модуль:ArmorStats: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 41: | Строка 41: | ||
-- Вычисляем цвет рамки (чуть темнее заданного цвета) | -- Вычисляем цвет рамки (чуть темнее заданного цвета) | ||
local borderColor = darkenColor(color) | local borderColor = darkenColor(color) | ||
-- Создание HTML с помощью mw.html.create | |||
local div = mw.html.create('div') | |||
div:addClass(divClass) | |||
-- Формирование строк для ячеек таблицы | -- Формирование строк для ячеек таблицы | ||
local | local tableContent = "" | ||
tableContent = tableContent .. '!style="background-color: ' .. color .. ';border-top: 1px solid ' .. borderColor .. ';border-bottom: 1px solid ' .. borderColor .. ';border-left: 2px solid ' .. borderColor .. ';"|' .. anchor | |||
tableContent = tableContent .. imageTooltip | |||
tableContent = tableContent .. '<br>' .. itemName .. '\n' | |||
tableContent = tableContent .. '|style="font-weight:bold;color: crimson;background-color: ' .. backgroundColor .. '"|' .. protBlunt .. '\n' | |||
tableContent = tableContent .. '|style="font-weight:bold;color: indianred;background-color: ' .. backgroundColor .. '"|' .. protSlash .. '\n' | |||
tableContent = tableContent .. '|style="font-weight:bold;color: darksalmon;background-color: ' .. backgroundColor .. '"|' .. protPiercing .. '\n' | |||
tableContent = tableContent .. '|style="font-weight:bold;color: orange;background-color: ' .. backgroundColor .. '"|' .. protHeat .. '\n' | |||
tableContent = tableContent .. '|style="font-weight:bold;color: plum;background-color: ' .. backgroundColor .. '"|' .. protRadiation .. '\n' | |||
tableContent = tableContent .. '|style="font-weight:bold;color: limegreen;background-color: ' .. backgroundColor .. '"|' .. protCaustic .. '\n' | |||
tableContent = tableContent .. '|style="font-weight:bold;color: tan;background-color: ' .. backgroundColor .. '"|' .. protExplosion .. '\n' | |||
tableContent = tableContent .. '|style="background-color: ' .. backgroundColor .. '"|\n' .. description .. '\n' | |||
tableContent = tableContent .. '|style="background-color: ' .. backgroundColor .. '"|\n' .. location .. '\n|-' | |||
div:wikitext(tableContent) | |||
return | return tostring(div) | ||
end | end | ||
return p | return p | ||