跳转到内容
打开/关闭搜索
搜索
打开/关闭菜单
397
文件
1979
用户
1.2万
编辑
Gal中文百科
导航
首页
最近更改
随机页面
MediaWiki帮助
特殊页面
在其他项目中
打开/关闭外观设置菜单
无法加载偏好设置。请检查您的网络连接并重试。
重试
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
讨论
贡献
创建账号
登录
编辑“︁
Module
:
角色立绘
”︁
来自Gal中文百科
查看
阅读
编辑源代码
查看历史
associated-pages
模块
讨论
更多操作
更多
工具
链入页面
相关更改
页面信息
警告:
您没有登录。如果您进行任何编辑,您的IP地址会公开展示。如果您
登录
或
创建账号
,您的编辑会以您的用户名署名,此外还有其他益处。
反垃圾检查。
不要
加入这个!
local p = {} -- 去除空格 local function trim( str ) if not str then return "" end return mw.text.trim( str ) end -- 解析立绘:Aya.png:常服; Aya_school.png:校服 local function parse( value ) local list = {} value = trim( value ) if value == "" then return list end for item in string.gmatch( value, "([^;]+)" ) do item = trim( item ) local file, label = item:match( "^([^:]+):?(.*)$" ) table.insert( list, { file = trim( file ), label = trim( label ) } ) end return list end -- 立绘轮播,供卡片主体使用 function p.main( frame ) local args = frame.args local images = args["图片"] or "" local name = args["角色名"] or "" local list = parse( images ) if #list == 0 then return "" end local html = {} html[#html + 1] = '<div class="portrait-slides">' for i, v in ipairs( list ) do local active = "" if i == 1 then active = " active" end html[#html + 1] = '<div class="portrait-slide' .. active .. '">' html[#html + 1] = '[[File:' .. v.file .. '|link=|alt=' .. name .. ']]' if v.label ~= "" then html[#html + 1] = '<span class="portrait-label">' .. v.label .. '</span>' end html[#html + 1] = '</div>' end html[#html + 1] = '</div>' -- 多图才显示按钮 if #list > 1 then html[#html + 1] = '<div class="character-card__switch" title="切换立绘">' .. '⇄' .. '</div>' end return table.concat( html ) end -- 取第一张立绘的文件名,供画廊缩略项使用 -- {{#invoke:角色立绘|first|图片={{{角色立绘|}}}}} function p.first( frame ) local list = parse( frame.args["图片"] or "" ) if #list == 0 then return "" end return list[1].file end return p
摘要:
请注意,所有对Gal中文百科的贡献均可能会被其他贡献者编辑、修改或删除。如果您不希望您的文字作品被随意编辑,请不要在此提交。
您同时也向我们承诺,您提交的内容为您自己所创作,或是复制自公共领域或类似自由来源(详情请见
Gal中文百科:著作权
)。
未经许可,请勿提交受著作权保护的作品!
取消
编辑帮助
(在新窗口中打开)
此页面嵌入的页面:
Module:角色立绘/doc
(
编辑
)
编辑“︁
Module
:
角色立绘
”︁
来自Gal中文百科