Модуль:Prototypes/Роль/Лодаут: различия между версиями

Нет описания правки
Метка: ручная отмена
мНет описания правки
Строка 13: Строка 13:
     end
     end
     local roleId = "Job" .. roleParam
     local roleId = "Job" .. roleParam
     local modeTrinkets = (searchKey == "trinkets")
     local modeTrinkets = (searchKey == "trinkets")
    local modeBackStorage = (searchKey == "backStorage")
     local results = {}
     local results = {}
     local role = nil
     local role = nil
Строка 80: Строка 82:
                                         printedTrinkets[trinket] = true
                                         printedTrinkets[trinket] = true
                                         table.insert(results, '{{#invoke:Prototypes/Предмет/Содержание|frame|' .. trinket .. '}}')
                                         table.insert(results, '{{#invoke:Prototypes/Предмет/Содержание|frame|' .. trinket .. '}}')
                                    end
                                end
                            elseif modeBackStorage then
                                if loadout.storage and loadout.storage.back then
                                    for _, eqValue in ipairs(loadout.storage.back) do
                                        local extraInfo = ""
                                        if loadout.effects then
                                            for _, effect in ipairs(loadout.effects) do
                                                if effect["!type"] == "GroupLoadoutEffect" then
                                                    local proto = effect.proto
                                                    if proto then
                                                        for _, candidate in ipairs(gearloadout) do
                                                            if candidate.id == proto then
                                                                if candidate.effects then
                                                                    for _, eff in ipairs(candidate.effects) do
                                                                        if eff["!type"] == "JobRequirementLoadoutEffect" and eff.requirement then
                                                                            local req = eff.requirement
                                                                            if req["!type"] == "DepartmentTimeRequirement" and req.department and req.time then
                                                                                extraInfo = extraInfo .. "<b>{{ucfirst:{{#invoke:Ftl|main|translation|department-" .. req.department .. "}}}}</b>: " .. req.time .. "<br>"
                                                                            elseif req["!type"] == "RoleTimeRequirement" and req.role and req.time then
                                                                                extraInfo = extraInfo .. "<b>{{ucfirst:{{#invoke:Ftl|main|translation|" .. req.role .. "}}}}</b>: " .. req.time .. "<br>"
                                                                            end
                                                                        end
                                                                    end
                                                                end
                                                                break
                                                            end
                                                        end
                                                    end
                                                end
                                            end
                                        end
                                        local infoOutput = ""
                                        if extraInfo ~= "" then
                                            infoOutput = '<div class="роль-лодаут__time">{{AltTooltip|[[Файл:Small_watch.png|link=]]|' .. extraInfo .. '}}</div>'
                                        end
                                        table.insert(results, infoOutput .. '{{#invoke:Prototypes/Предмет/Содержание|image|' .. eqValue .. '}} [[File:Slot.png|64px|link=]]')
                                     end
                                     end
                                 end
                                 end