打开/关闭搜索
搜索
打开/关闭菜单
331
1.7K
131
11.8K
星露谷物语扩展百科
导航
首页
最近更改
随机页面
交流群
互通站
上传文件
打开/关闭外观设置菜单
通知
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。
user-interface-preferences
个人工具
创建账号
登录
查看“︁模块:GiftsByItem”︁的源代码
来自星露谷物语扩展百科
查看
阅读
查看源代码
查看历史
associated-pages
模块
讨论
更多操作
←
模块:GiftsByItem
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:已验证邮箱用户
您必须确认您的电子邮件地址才能编辑页面。请通过
参数设置
设置并确认您的电子邮件地址。
您可以查看和复制此页面的源代码。
local Utils = require("Module:Utils") local ID = require("Module:Expanded/ID") local Vanilla = require("Module:GiftsByItem") local p = {} -- SVE 新增人物 local newVillagers = { ["Lance"] = "兰斯", ["Magnus"] = "马格努斯", ["Marlon"] = "马龙", ["Martin"] = "马丁", ["Morgan"] = "摩根", ["Morris"] = "莫里斯", ["Olivia"] = "奥利维亚", ["Andy"] = "安迪", ["Scarlett"] = "斯嘉丽", ["Sophia"] = "索菲娅", ["Susan"] = "苏珊", ["Victor"] = "维克多", ["Henchman"] = "仆从", ["Claire"] = "克莱尔", ["Gunther"] = "冈瑟", ["Apples"] = "苹果" } local orderAdditions = { "索菲娅", "维克多", "克莱尔", "马丁", "安迪", "苏珊", "奥利维亚", "兰斯", "斯嘉丽", "莫里斯", "马龙", "冈瑟", "仆从", "马格努斯", "摩根", "苹果" } -- 缓存合并后的数据 local translationMap local orderList local originalMap local orderIndexMap -- 初始化函数 local function initializeData() if translationMap then return end translationMap = {} for k, v in pairs(Vanilla.translation) do translationMap[k] = v end for k, v in pairs(newVillagers) do translationMap[k] = v end orderList = {} for _, name in ipairs(Vanilla.predefinedOrder) do table.insert(orderList, name) end for _, name in ipairs(orderAdditions) do table.insert(orderList, name) end originalMap = {} for en, zh in pairs(translationMap) do originalMap[zh] = en end orderIndexMap = {} for i, name in ipairs(orderList) do orderIndexMap[name] = i end end -- SVE 的主函数 function p.tssve(frame) initializeData() local villagerlist = frame.args[1] return Vanilla.processVillagers(villagerlist, translationMap, orderIndexMap, originalMap, "SVE") end -- 重写 getCurrentProcessor 函数,返回 SVE 的处理函数 function p.getCurrentProcessor() return p.tssve end -- 重写 getCurrentIDFunction 函数,返回 SVE 的 ID 函数 function p.getCurrentIDFunction() return ID.getId end -- 重写 getCurrentDataSource 函数,返回 SVE 的数据源 function p.getCurrentDataSource() return Utils.LazyLoad('Module:Expanded/GiftsByItem/data') end -- SVE 的 generateGiftTable 函数 function p.generateGiftTable(frame) return Vanilla.generateGiftTable(frame, p.getCurrentProcessor(), p.getCurrentIDFunction(), p.getCurrentDataSource()) end -- 导出一些有用的数据和函数 p.newVillagers = newVillagers p.orderAdditions = orderAdditions p.base = Vanilla function p.getTranslationMap() initializeData() return translationMap end function p.getOrderList() initializeData() return orderList end return p
该页面嵌入的页面:
模板:Documentation header
(
查看源代码
)
模板:Template link
(
查看源代码
)
模板:Tl
(
查看源代码
)
模块:Array
(
查看源代码
)
模块:Documentation
(
查看源代码
)
模块:Documentation/styles.css
(
查看源代码
)
模块:GiftsByItem/doc
(
查看源代码
)
模块:ProcessArgs
(
查看源代码
)
模块:STConversion
(
查看源代码
)
模块:Static
(
查看源代码
)
模块:TSLoader
(
查看源代码
)
返回
模块:GiftsByItem
。
查看“︁模块:GiftsByItem”︁的源代码
来自星露谷物语扩展百科