Dota 2 Wiki

你现在尚未登录,许多功能可能无法正常使用,若已有账号,请登录,若没有,请先注册Twitch账号
目前我们有非常多的待翻译条目,你也可以看一下目前我们需要优先处理的有哪些目前我们有非常多的待翻译条目,你也可以看一下目前我们需要优先处理的有哪些英雄页面的攻略、克制和物品页面的推荐英雄、小贴士等均为社区玩家编写的,你也可以把自己的心得写上去哦。英雄页面的攻略、克制和物品页面的推荐英雄、小贴士等均为社区玩家编写的,你也可以把自己的心得写上去哦。看不懂技能的buff/debuff是哪个跟哪个?鼠标移动到名称上就能看到游戏内显示的名字和描述了。看不懂技能的buff/debuff是哪个跟哪个?鼠标移动到名称上就能看到游戏内显示的名字和描述了。目前我們沒有善於製作其他中文變體的人員,如果您善於或擁有相關技術,請幫忙補充其他中文變體的空白。目前我們沒有善於製作其他中文變體的人員,如果您善於或擁有相關技術,請幫忙補充其他中文變體的空白。

了解更多

Dota 2 Wiki
Advertisement
可打印版不再被支持且可能有渲染错误。请更新您的浏览器书签并改用浏览器默认的打印功能。
Reality Rift icon
▶️ Planeshift.
该module的文档可以在Template:Tabber找到。
You may be forwarded to another wiki language, in case a translation is not available.



local p = {}
local getArgs = require( 'Module:Arguments' ).getArgs


-- Implements Template:Tabs Hero.
function p.hero(frame)
  local args = getArgs(frame, {
    wrappers = {
      'Template:Tabs Hero'
    }
  })
  local hero = args[1] or mw.title.getCurrentTitle().baseText -- Use {{BASEPAGENAME}} if no page is given.
  
  local subpage = function( page ) return hero .. '/' .. page end
  local custom = function( number ) if args['custom' .. number] then return subpage( args['custom' .. number] ) end end
  
  local tabs = { 
    ['this'] = args['this'],
    
    ['link1'] = hero,
    ['name1'] = '英雄',
    
    ['link2'] = subpage( '攻略' ),
    ['name2'] = '攻略',
    
    ['link3'] = subpage( '克制' ),
    ['name3'] = '克制',
    
    ['link4'] = subpage( '装备' ),
    ['name4'] = '装备',
    
    ['link5'] = subpage( '相关饰品' ),
    ['name5'] = '相关饰品',
    
    ['link6'] = subpage( '天赋' ),
    ['name6'] = '天赋',

    ['link7'] = subpage( '圣物' ),
    ['name7'] = '圣物',
    
    ['link8'] = subpage( '台词' ),
    ['name8'] = '台词',
    
    ['link9'] = subpage( '音效' ),
    ['name9'] = '音效',
    
    ['link10'] = subpage( '背景故事' ),
    ['name10'] = '背景故事',
    
    ['link11'] = custom( '1' ),
    ['name11'] = args['custom1'],
    
    ['link12'] = custom( '2' ),
    ['name12'] = args['custom2'],
    
    ['link13'] = subpage( '旧的技能' ),
    ['name13'] = '旧的技能',
    
    ['link14'] = subpage( '改动日志' ),
    ['name14'] = '改动日志',
    
    ['link15'] = subpage( 'Bugs' ),
    ['name15'] = '已知Bug',
  }
  
  return p._main( tabs )
end

-- Implements Template:Tabber.
function p.main(frame)
  local args = getArgs(frame, {
    wrappers = {
      'Template:Tabber'
    }
  })
  return p._main( args )
end

function p._main( args )
  local current_page = args['this'] or mw.title.getCurrentTitle().prefixedText

  local rows = {}
  for n=1,15 do
    if args['link' .. n] then
      -- Use the link as the name if none is given.
      local name = args['name' .. n] or args['link' .. n]
      if args['link' .. n] == current_page then
        -- The active tab.
        table.insert( rows, string.format( '<div class="page-tabber-tab active-tab">%s</div>', name ) )
      else
        -- The inactive tabs.
        local link = string.format( '[[%s|%s]]', args['link' .. n], name )
        table.insert( rows, string.format( '<div class="page-tabber-tab inactive-tab">%s</div>', link ) )
      end
    end
  end
  
  -- The separator is used for the space between two tabs.
  local separator = '\n<div class="page-tabber-separator">&nbsp;</div>\n'
  -- The tail fills the space between the last tab and the end of the line.
  local tail = '<div class="page-tabber-separator tail">&nbsp;</div>'
  
  return string.format( '<div id="pageTabber" class="page-tabber">\n%s\n%s\n</div>', table.concat( rows, separator ), tail )
end

return p
Advertisement