1136
правок
Изменения
м
elseif head ~= '' then
local input = mw.text.trim( args[1] or args["Ресурс"] or '' )
local output = mw.text.trim( args[2] or args["Выход"] or '' )
nameCell = table.concat( links, ' или<br>' )
end if nameCell and args["запланированное"] then nameCell = nameCell .. '<br>(' .. args["запланированное"] .. ')' end
ingredientsCell local mod = ( ingredients[v] or animatedIngredients[v] ).mod local name = ( ingredients[v] or animatedIngredients[v] ).name table.concatinsert( ingredientsCell, '<br>\n' prefixedLink( name, mod ) .. separator )
if args["отладка"] == '1' then
return '<pre>' .. header .. '\n' .. row .. '\n|-\n' .. footer .. categories .. '</pre>'
else
return header .. '\n' .. row .. '\n|-\n' .. footer .. categories
end
end
Тест
if multirow then
head = ''
multirow = 1
f:callParserFunction( '#dplvar:set', 'multirow', '1' )
end
local fuel = args["топливо"] or args["Топливо"] or ''
if fuel == '' and (args["Мод"] == 'IndustrialCraft 2' or 'GregTech' and args['Расход'] == 'Электричество') then
-- Ячейка с названием
local nameCell
if f:callParserFunction( '#dplvar', 'craftingnamesmeltingname' ) == '1' then if args["название"] or '' ~= '' then nameCell = args["название"] else local names = {} local links = {} for v in mw.text.gsplit( args[2] or args["Выход"] or '', '%s*;%s*' ) do parts = getParts( v, args["Мод"] ) parts.mod = parts.mod or '' if not names[( parts.mod or .. ':' ) .. parts.name] and output ~= '' then table.insert( links, prefixedLink( parts.name, parts.mod ) ) names[parts.mod .. ':' .. parts.name] = 1 end
end
nameCell = table.concat( links, ' или<br>' )
end
end
-- Создать список ингредиентов
else
ingredientsCell = {}
for k, v in ipairs{ input, fuel } ( ingredientKeys ) do
local separator = ' +'
if k == 2 and next( ingredients ) #ingredientKeys then separator = ' +<br>\n' elseif animatedIngredients[v] and not animatedIngredients[v].final then separator = ' или' end local mod = ( ingredients[v] or animatedIngredients[v] ).mod local name = ( ingredients[v] or animatedIngredients[v] ).name table.insert( ingredientsCell, prefixedLink( name, mod ) .. separator )
end
end
ingredientsCell = table.concat( ingredientsCell, '<br>\n' )
end
-- Остальные аргументы
local newArgs = {} newArgs["Ресурс"] = args[1] or args["Ресурс"], newArgs["Выход"] = args[2] or args["Выход"], newArgs["Топливо"] = fuel, newArgs["РНазв"] = args["рНазв"], newArgs["ВНазв"] = args["вНазв"], newArgs["ТНазв"] = args["тНазв"], newArgs["Мод"] = args["Мод"], newArgs["Прогресс"] = args["Прогресс"], newArgs["Расход"] = args["Расход"]}
-- Ячейка с рецептом
end
end
end
end
end
end
return header .. '\n' .. row .. '\n|-\n' .. footer .. category
end
return p