Модуль:Песочница/Pok: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 57: | Строка 57: | ||
local iconPath = tech.icon and tech.icon.sprite or nil | local iconPath = tech.icon and tech.icon.sprite or nil | ||
-- Формирование строки prerequisites | |||
local prerequisitesStr = "" | |||
if tech.technologyPrerequisites and #tech.technologyPrerequisites > 0 then | |||
prerequisitesStr = '<ul>' | |||
for _, prerequisite in ipairs(tech.technologyPrerequisites) do | |||
if prerequisite and prerequisite ~= "" then | |||
prerequisitesStr = prerequisitesStr .. '<li>{{#invoke:Entity Lookup|createimagetooltip|Файл:' | |||
.. prerequisite .. '.png|' .. prerequisite | |||
.. '|Мета=32x32px,link=}}' | |||
.. prerequisite .. '</li>' | |||
end | |||
end | |||
prerequisitesStr = prerequisitesStr .. '</ul>' | |||
end | |||
-- Формирование строки unlocks | |||
local unlocksStr = "" | |||
if tech.recipeUnlocks and #tech.recipeUnlocks > 0 then | |||
unlocksStr = '<ul>' | |||
for _, recipe in ipairs(tech.recipeUnlocks) do | |||
if recipe and recipe ~= "" then | |||
unlocksStr = unlocksStr .. '<li>{{#invoke:Entity Lookup|createimagetooltip|Файл:' | |||
.. recipe .. '.png|' .. recipe | |||
.. '|Мета=32x32px,link=}} {{#invoke:Entity Lookup|getname|' | |||
.. recipe .. '}}</li>' | |||
end | |||
end | |||
unlocksStr = unlocksStr .. '</ul>' | |||
end | |||
-- Формируем вывод с использованием шаблона | -- Формируем вывод с использованием шаблона | ||