Модуль:Prototypes/Механика/Исследование
Материал из Space Station 14 Вики
Версия от 11:04, 6 октября 2024; Pok (обсуждение | вклад)
Для документации этого модуля может быть создана страница Модуль:Prototypes/Механика/Исследование/doc
local p = {}
function p.main(frame)
local icon = frame.args.itemId or ""
local name = frame.args.name or ""
local discipline = frame.args.discipline or ""
local tier = frame.args.tier or ""
local cost = frame.args.cost or ""
local recipeUnlocks = frame.args.recipeUnlocks or ""
local disciplineIcon = ""
local disciplineName = ""
local out = ""
if discipline == "Arsenal" then
disciplineName = "Арсенал"
elseif discipline == "Industrial" then
disciplineName = "Промышленность"
elseif discipline == "Experimental" then
disciplineName = "Экспериментальное"
elseif discipline == "CivilianServices" then
disciplineName = "Обслуживание персонала"
end
out = out .. '<div class="research" id="'.. discipline ..'">'
out = out .. '<div class="research__images">[[Файл:' .. icon .. '.png|64px|центр|link=]]</div>'
out = out .. '<div class="research__name">' .. name .. '[[Файл:' .. discipline .. '.png|16px|link=]]</div>'
out = out .. '<div class="research__type">'
out = out .. '<div>Уровень: ' .. tier .. ' ,</div>'
out = out .. '<div class="research__category">' .. disciplineName .. '</div>'
out = out .. '<div>Стоимость: <span style="color:#DA70D6;">' .. cost .. '</span></div>'
out = out .. '</div>'
out = out .. '<div class="research__unblocks">Разблокирует:'
out = out .. '<ul>'
out = out .. frame:preprocess('<li>{{#invoke:Entity Lookup|createimagetooltip|Файл:' .. recipeUnlocks .. '.png|'.. recipeUnlocks .. '|Мета=32x32px,link=}} {{#invoke:Entity Lookup|getname|' .. recipeUnlocks .. '}}</li>')
out = out .. '</ul>'
out = out .. '</div>'
out = out .. '</div>'
return out
end
return p