2734
правки
Изменения
-------------------------------------------------------------------
--- Модуль для отображения инвентарных слотов в Minecraft Wiki.
-------------------------------------------------------------------
local ids = mw.loadData([[Модуль:ИнвСпрайт/ID]])["IDы"]
local modIds = {}
local animated = mw.ustring.find(args[1]:find( , ';' )
local pageName = mw.title.getCurrentTitle().text
local imgClass = args["классизобр"]
link = mod .. '/' .. name
else
link = name:mw.ustring.gsub( name, '^Повреждённ[ыао][йяе] ', '')
end
elseif link:mw.ustring.lower(link) == 'нет' then
link = nil
end
if title == '' then
plainTitle = name
elseif title:mw.ustring.lower(title) ~= 'нет' then plainTitle = title:mw.ustring.gsub(mw.ustring.gsub( title, '\\\\', '\' ):gsub( , '\\&', '&' )
local formatPattern = '&[0-9a-fk-or]'
if plainTitle:mw.ustring.match( plainTitle, formatPattern ) then
formattedTitle = title
plainTitle = plainTitle:mw.ustring.gsub( plainTitle, formatPattern, '' )
end
plainTitle = name
else
plainTitle = plainTitle: mw.ustring.gsub(mw.ustring.gsub( plainTitle, '\', '\\' ):gsub( , '&', '&' )
end
elseif link then
}
end
item:node(image)
category = spriteCat
aliasParts.text = frameParts.text or aliasParts.text or ''
table.insert( expandedFrames, stringmw.ustring.format(
'[%s]%s:%s,%s[%s]',
aliasParts.title, aliasParts.mod, aliasParts.name, aliasParts.num, aliasParts.text
) )
end
function p.getParts(frame, mod)
local parts = {}
parts.title = frame:mw.ustring.match( frame, '^%[%s*([^%]]+)%s*%]' )
parts.mod = mw.text.trim( frame:mw.ustring.match( frame, '([^:%]]+):' ) or mod or '' )
local vanilla = {v = 1, vanilla = 1, mc = 1, minecraft = 1}
end
local nameStart = ( frame:mw.ustring.find( frame, ':' ) or frame:mw.ustring.find( frame, '%]' ) or 0 ) + 1
if nameStart - 1 == #frame then
nameStart = 1
end
parts.name = mw.text.trim( frame:mw.ustring.sub( frame, nameStart, ( frame:mw.ustring.find( frame, '[,%[]', nameStart ) or 0 ) - 1 ) )
parts.num = math.floor( frame:mw.ustring.match( frame, ',%s*(%d+)' ) or 0 )
if parts.num == 0 then
parts.num = nil
end
parts.text = frame:mw.ustring.match( frame, '%[%s*([^%]]+)%s*%]$' )
return parts