Модуль:Песочница/Pok: различия между версиями

мНет описания правки
мНет описания правки
Строка 57: Строка 57:
             local iconPath = tech.icon and tech.icon.sprite or nil
             local iconPath = tech.icon and tech.icon.sprite or nil


            -- Формирование строки prerequisites
-- Формирование строки prerequisites
            local prerequisitesStr = ""
local prerequisitesStr = ""
            if tech.technologyPrerequisites and #tech.technologyPrerequisites > 0 then
if tech.technologyPrerequisites and #tech.technologyPrerequisites > 0 then
                prerequisitesStr = '<ul>'
    prerequisitesStr = '<ul>'
                for _, prerequisite in ipairs(tech.technologyPrerequisites) do
    for _, prerequisite in ipairs(tech.technologyPrerequisites) do
                    if prerequisite and prerequisite == "" then  
        if prerequisite and prerequisite ~= "" then  
                        prerequisitesStr = prerequisitesStr .. '<li>{{#invoke:Entity Lookup|createimagetooltip|Файл:'  
            prerequisitesStr = prerequisitesStr .. '<li>{{#invoke:Entity Lookup|createimagetooltip|Файл:'  
                            .. prerequisite .. '.png|' .. prerequisite  
                .. prerequisite .. '.png|' .. prerequisite  
                            .. '|Мета=32x32px,link=}}'  
                .. '|Мета=32x32px,link=}}'  
                            .. prerequisite .. '</li>'
                .. prerequisite .. '</li>'
                    end
        end
                end
    end
                prerequisitesStr = prerequisitesStr .. '</ul>'
    prerequisitesStr = prerequisitesStr .. '</ul>'
            end
end
 
            -- Формирование строки unlocks
-- Формирование строки unlocks
            local unlocksStr = ""
local unlocksStr = ""
            if tech.recipeUnlocks and #tech.recipeUnlocks > 0 then
if tech.recipeUnlocks and #tech.recipeUnlocks > 0 then
                unlocksStr = '<ul>'
    unlocksStr = '<ul>'
                for _, recipe in ipairs(tech.recipeUnlocks) do
    for _, recipe in ipairs(tech.recipeUnlocks) do
                    if recipe and recipe == "" then  
        if recipe and recipe ~= "" then  
                        unlocksStr = unlocksStr .. '<li>{{#invoke:Entity Lookup|createimagetooltip|Файл:'  
            unlocksStr = unlocksStr .. '<li>{{#invoke:Entity Lookup|createimagetooltip|Файл:'  
                            .. recipe .. '.png|' .. recipe  
                .. recipe .. '.png|' .. recipe  
                            .. '|Мета=32x32px,link=}} {{#invoke:Entity Lookup|getname|'  
                .. '|Мета=32x32px,link=}} {{#invoke:Entity Lookup|getname|'  
                            .. recipe .. '}}</li>'
                .. recipe .. '}}</li>'
                    end
        end
                end
    end
                unlocksStr = unlocksStr .. '</ul>'
    unlocksStr = unlocksStr .. '</ul>'
            end
end


             -- Формируем вывод с использованием шаблона
             -- Формируем вывод с использованием шаблона