查看“︁模块:EquipmentInfoList”︁的源代码
←
模块:EquipmentInfoList
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于这些用户组的用户执行:
管理员
、trusted
您可以查看和复制此页面的源代码。
local p = {} function p.list(frame) local args = (frame == mw.getCurrentFrame() and frame.args) or frame local token_name = mw.text.trim(args["token_alias"] or "") local token_icon_file = mw.text.trim(args["token_icon"] or "道具_" .. token_name .. ".png") local token_icon_size = mw.text.trim(args["token_icon_size"] or "30px") local data_str = mw.text.trim(args["data"] or "") local nocss = mw.text.trim(args["nocss"] or "") local token_icon = string.format("[[File:%s|%s|link=]]", token_icon_file, token_icon_size) local selectall_str = frame:callParserFunction{name = '#Widget:ShopItemSelectAll', args = {item = token_name}} local checkbox_css = frame:callParserFunction{name = '#Widget:ShopItemListCss'} res_table = {} if nocss=="" then table.insert(res_table, checkbox_css .. "\n") end table.insert(res_table, '{| class="wikitable logo eventshoplist" style="white-space:normal;width:600px;max-width:100%;display:table;"\n') table.insert(res_table, string.format('!style="width:1.5em;"|%s!!可兑换道具!!style="width:5.0em;"|库存!!style="width:6.0em;"|单价\n', selectall_str)) local data_table = mw.text.split(data_str, "\n", true) local colorTable = {["金"]="#FFE0B2",["紫"]="#D1C4E9",["蓝"]="#BBDEFB",["灰"]="#E0E0E0",["复刻"]="linear-gradient(90deg,#b2f7ff,#bfb0f9);",["彩"]="linear-gradient(90deg,#FFE082,#FFCCBC,#A5D6A7,#FFCC80);"} local cur_collapseGroup = nil local cur_collapseGroupCollapse = nil for i = 1, #data_table do local datum_table = mw.text.split(data_table[i], ";;", true) local name = mw.text.trim(datum_table[2] or "") if datum_table[1]:sub(1,1)=='G' then --折叠模式 groupParam = mw.text.split(datum_table[1], "/", true) if groupParam[2] == 'X' then --结束折叠呼号 cur_collapseGroup = nil cur_collapseGroupCollapse = nil else --执行折叠呼号 cur_collapseGroup = groupParam[2] --取出ID cur_collapseGroupCollapse = (not groupParam[3]) and true or false --是否不折叠(直接显示) --换行符 local str = '|-' if datum_table[3] or datum_table[4] then str = str .. "style=\"text-align:center; " if datum_table[3] then str = str.."background:"..datum_table[3].."; " end if datum_table[4] then str = str.."color:"..datum_table[4]..";" end str = str .."\"" end str = str .. "\n" table.insert(res_table, str) --标题 table.insert(res_table, string.format("|colspan=3|'''%s'''\n", name)) --按钮 str = "|class=\"mw-customtoggle-eventShopList%s mw-collapsible __isC1__\" id=\"mw-customcollapsible-eventShopList%s\"|展开 <span class=\"mdi mdi-chevron-down\"></span>\n" str = str .. "|class=\"mw-customtoggle-eventShopList%s mw-collapsible __isC2__\" id=\"mw-customcollapsible-eventShopList%s\"|收起 <span class=\"mdi mdi-chevron-up\"></span>\n" str = string.format(str, cur_collapseGroup, cur_collapseGroup, cur_collapseGroup, cur_collapseGroup) if not cur_collapseGroupCollapse then --为空时不折叠 str = (str:gsub("__isC1__", "mw-collapsed")):gsub("__isC2__", "") else str = (str:gsub("__isC1__", "")):gsub("__isC2__", "mw-collapsed") end table.insert(res_table, str) end elseif datum_table[1]=='X' then --普通标题 table.insert(res_table, '|-\n') if datum_table[3] or datum_table[4] then local str = "|style=\"text-align:center; " if datum_table[3] then str = str.."background:"..datum_table[3].."; " end if datum_table[4] then str = str.."color:"..datum_table[4]..";" end str = str..string.format("\" colspan=4|'''%s'''\n", name) table.insert(res_table, str) else table.insert(res_table, string.format("!colspan=4|%s\n", name)) end elseif datum_table[1]=='C' then --注释 table.insert(res_table, '|-\n') local str = "|__style__ __curColl__ colspan=4|%s\n" if datum_table[3] or datum_table[4] then local sstr = "" if datum_table[3] then sstr = sstr.."background:"..datum_table[3].."; " end if datum_table[4] then sstr = sstr.."color:"..datum_table[4]..";" end str = str:gsub("__style__", sstr) else str = str:gsub("__style__", "") end if cur_collapseGroup then local cgstr = ("class=\"mw-collapsible __isC__\" id=\"mw-customcollapsible-eventShopList%s\""):format(cur_collapseGroup) cgstr = cgstr:gsub("__isC__", cur_collapseGroupCollapse and "mw-collapsed" or "") str = str:gsub("__curColl__", cgstr) else str = str:gsub("__curColl__", "") end str = string.format(str, name) table.insert(res_table, str) else --商品 local color = mw.text.trim(datum_table[5] or "") local textColor = mw.text.trim(datum_table[6] or "") local checkbox_str = "" local num_limit = tonumber(mw.text.trim(datum_table[3] or "")) local unit_price = tonumber(mw.text.trim(datum_table[4] or "")) if num_limit ~= nil and unit_price ~= nil then checkbox_str = frame:expandTemplate{title = "商店列表复选框", args = { token_name, num_limit * unit_price, ((datum_table[1] == '1') and "是" or "否")}} end local num_limit_str = (num_limit ~= nil) and num_limit or mw.text.trim(datum_table[3] or "——") local unit_price_str = (unit_price ~= nil) and tostring(unit_price) or mw.text.trim(datum_table[4] or "——") --换行 local str = '|-__style__ __curColl__\n' if color~="" or textColor~="" then str = str:gsub("__style__", string.format("style=\"background:%s;color:%s\"", colorTable[color] or color, textColor) ) else str = str:gsub("__style__ ", "") end if cur_collapseGroup then local cgstr = ("class=\"mw-collapsible __isC__\" id=\"mw-customcollapsible-eventShopList%s\""):format(cur_collapseGroup) cgstr = cgstr:gsub("__isC__", cur_collapseGroupCollapse and "mw-collapsed" or "") str = str:gsub("__curColl__", cgstr) else str = str:gsub("__curColl__", "") end table.insert(res_table, str) --table.insert(res_table, (color ~= "") and (string.format('|-style="background:%s"\n', color)) or ('|-\n')) table.insert(res_table, string.format("|%s||%s||%s||%s%s\n", checkbox_str, name, num_limit_str, token_icon, unit_price_str)) end end local total_str = frame:callParserFunction{name = '#Widget:ShopItemTotalCost', args = {item = token_name}} table.insert(res_table, '|-\n') table.insert(res_table, string.format('| ||colspan="2"|勾选项目总价||%s\'\'\'%s\'\'\'\n', token_icon, total_str)) table.insert(res_table, '|}') return table.concat(res_table) end return p
该页面使用的模板:
模块:EquipmentInfoList/doc
(
查看源代码
)
返回
模块:EquipmentInfoList
。
导航菜单
个人工具
创建账号
登录
命名空间
模块
讨论
English
查看
阅读
查看源代码
查看历史
更多
搜索
XX
导航
首页
搜索
异界相关
异界3期装备掉落表
异界2期装备掉落表
时空之门 & 卡勒特指挥部
70史诗 - 武器
兰总远古粉 - 75粉
工具
链入页面
相关更改
页面信息
网页维护
随机页面
最近更改
特殊页面
随机页面
MediaWiki帮助
特殊页面