打开/关闭搜索
搜索
打开/关闭菜单
317
258
301
4K
异世界百科
导航
首页
alt z
最近更改
alt r
随机页面
alt x
帮助
特殊页面
alt q
上传文件
alt u
相关网站
异世界资料库
常用功能
翻译页面
全部页面列表
切换首选项菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
中文(中国大陆)
个人工具
登录/创建账号
alt o
查看“︁模块:CharacterInfo”︁的源代码
来自异世界百科
分享此页面
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论/笔记
更多操作
←
模块:CharacterInfo
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
用户
您可以查看和复制此页面的源代码。
local p = {} function p.create(frame) -- 信息项 local name = frame.args.name local originalName = frame.args.original_name local age = frame.args.age local gender = frame.args.gender or frame.args.custom_gender local hairColor = frame.args.hair_color local eyesColor = frame.args.eyes_color local height = frame.args.height local weight = frame.args.weight local ethnic = frame.args.ethnic local parentSetting = frame.args.parent_setting or tostring(frame:getTitle()) -- 配置项 local picture = frame.args.picture local displayType = frame.args.display_type local float = frame.args.float local content = frame.args.content or "" local dataAge = age -- 年龄不是数字,则不进入数据表 if not dataAge:match("^%-?%d+$") then dataAge = nil end local dataTable = { ["parent_setting"] = parentSetting } local infoTable = { ["title_key"] = "名字" } if name then infoTable["名字"] = name dataTable["name"] = name end -- 原语言名字显示为上标 if originalName then infoTable["名字"] = "{{上标|" .. name .. "|" .. originalName .. "}}" dataTable["original_name"] = originalName end if gender then infoTable["性别"] = gender dataTable["gender"] = gender end if age then infoTable["年龄"] = age end if dataAge then dataTable["age"] = dataAge end if hairColor then infoTable["发色"] = hairColor .. "色" dataTable["hair_color"] = hairColor end if eyesColor then infoTable["瞳色"] = eyesColor .. "色" dataTable["eyes_color"] = eyesColor end if height then infoTable["身高"] = height .. "cm" dataTable["height"] = height end if weight then infoTable["体重"] = weight .. "kg" dataTable["weight"] = weight end if ethnic then infoTable["种族"] = ethnic dataTable["ethnic"] = ethnic end if picture then infoTable["picture"] = picture dataTable["picture"] = picture end if displayType then infoTable["type"] = displayType else infoTable["type"] = "hidden" end if float then infoTable["float"] = float end local finalHtml = frame:expandTemplate{ title = "信息/角色", args = dataTable } -- 自动生成内容 if displayType ~= "hidden" then finalHtml = finalHtml .. frame:extensionTag("information", content, infoTable) end return finalHtml end return p
该页面使用的模板:
模块:CharacterInfo/doc
(
查看源代码
)
返回
模块:CharacterInfo
。