2734
правки
Изменения
Нет описания правки
local p = {}
local slot = require( [[Module:Inventory slot]] )
local getParts = slot.getParts
local prefixes = slot.prefixes
local function prefixedLink( name, mod )
local prefix = ''
for _, thisPrefix in pairs( prefixes ) do
if name:find( '^' .. thisPrefix .. ' ' ) then
prefix = thisPrefix .. ' '
name = name:gsub( '^' .. prefix, '' )
break
end
end
local page = ''
if mod and mod ~= '' then
page = 'Mods/' .. mod .. '/'
end
return prefix .. '[[' .. page .. name .. '|' .. name .. ']]'
end
function p.table( f )
local args = f
f = mw.getCurrentFrame()
end
-- Start table when appropriate
-- Name cell
local nameCell
if args.name or f:callParserFunction( '#dplvar', 'craftingname' ~) == '1' then nameCell = if args.name elseif multirow or f:callParserFunction( '#dplvar', 'smeltingname' ) =~= '1' then nameCell = args.name else local names = {} local links = {} for v in mw.text.gsplit( args[2] .Output or '', '%s*;%s*' ) do parts = getParts( v , args.Mod ) if not names[( parts.mod or '' ) .. = parts.name] then local link = mod or '' if parts.mod then link = 'Mods/' .. not names[parts.mod .. '/:' .. parts.name .. '|' end if parts.name:find( '^Any ' ) ] then table.insert( links, 'Any [[' .. link .prefixedLink( parts. name, parts.name:sub( 4 mod ) .. ']]' ) else tablenames[parts.mod ..insert( links, '[[:' .. link .. parts.name .. ']]' )= 1
end
end
nameCell = table.concat( links, ' or<br>' )
end
end