打开/关闭菜单
打开/关闭外观设置菜单
打开/关闭个人菜单
未登录
未登录用户的IP地址会在进行任意编辑后公开展示。

舰R百科是靠无数志愿编辑者持续地建设更新完善的。编辑非常简单,无需代码知识,请勇于更新页面!
编辑入门 | 资助百科 | 留言讨论页 | 微博@舰R百科 | 百科编辑讨论Q群:366818861

模块:图鉴:修订间差异

来自舰R百科
创建页面,内容为“local data = mw.loadData("模块:特殊数据") local ships = data.ships local byIndex = data.byIndex local p = { } local curFrame = nil local function expand(idx...”
 
无编辑摘要
第66行: 第66行:
     end
     end
     return ret
     return ret
end
p['按类型'] = function(frame)
    curFrame = frame
    local type = frame.args[1]
    local l = tonumber(frame.args[2])
    local r = tonumber(frame.args[3])
    local cnt = 0
    local ret = '{|\n|-valign="bottom"'
    for i = l, r do
        if byIndex[i] ~= nil and ships[byIndex[i]].type == type then
            if cnt < 5 then
                ret = ret .. '\n|width="200px"|' .. expand(i)
            else
                ret = ret .. '\n|' .. expand(i)
            end
            cnt = cnt + 1
            if cnt % 5 == 0 then
                ret = ret .. '\n|-'
            end
        end
    end
    if cnt % 5 ~= 0 then
        for i = cnt % 5 + 1, 5 do
            ret = ret .. '\n|'
        end
    end
    return ret .. '\n|}'
end
end


return p
return p