Module:BASkillSwitcher
跳到导航
跳到搜索
local getArgs = require('Module:Arguments').getArgs local p = {} local function toWikitext(text1) return mw.getCurrentFrame():preprocess(text1) end function p.db(frame) if (not frame) then frame = mw.getCurrentFrame() end local args = getArgs(frame) if (args['stype'] == "EX") then maxlv = 5 else maxlv = 10 end wikitext = "{{切换显示按钮|@forceNoCancel=1|@default=".. args['name']..args['stype'] .."SkillLv1|@radio=0" for i = 1, maxlv do wikitext = wikitext .. "|" .. args['name']..args['stype'] .. "SkillLv" .. i .. "=Lv." .. i end wikitext = wikitext .. "}}" return toWikitext(wikitext) end function p.le(frame) if (not frame) then frame = mw.getCurrentFrame() end local args = getArgs(frame) if (args['stype'] == "EX") then maxlv = 5 else maxlv = 10 end wikitext = "" for i = 1, maxlv do wikitext = wikitext .. "{{切换显示|"..args['name']..args['stype'].."SkillLv"..i.."|"..args[i].."}}" end return toWikitext(wikitext) end return p