Dota 2 Wiki

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

了解更多

Dota 2 Wiki
无编辑摘要
无编辑摘要
第1行: 第1行:
 
local cargo = mw.ext.cargo
 
local cargo = mw.ext.cargo
local color = require( 'Module:Color' )._main
+
local color = require('Module:Color')._main
local getArgs = require( 'Module:Arguments' ).main
+
local getArgs = require('Module:Arguments').main
 
local p = {}
 
local p = {}
   
function p.main( frame )
+
function p.main()
local args = getArgs()
+
local args = getArgs()
return p._main( args )
+
return p._main(args)
 
end
 
end
   
function p._main( args )
+
function p._main(args)
if args[1] then
+
assert(args[1], '没有输入饰品')
local size = args['userparam'] or args[2] or '100px'
 
local border = 'cos_common'
 
local icon = 'File:Cosmetic icon ' .. args[1] .. '.png'
 
 
-- Try getting data from the cargo table.
 
local cargo_output = cargo.query( 'cosmetic_items', 'image, rarity', { where='_pageName="' .. args[1] .. '"', groupBy='_pageID' } )[1]
 
if cargo_output then
 
border = 'cos_' .. string.lower(cargo_output['rarity'])
 
icon = cargo_output['image']
 
end
 
   
 
local icon = 'File:Cosmetic icon ' .. args[1] .. '.png'
return mw.html.create( 'div' )
 
 
local border = 'cos_common'
:attr( 'class', 'cosmetic-label' )
 
 
local size = args['userparam'] or args[2] or '100px'
:css( 'margin-left', '6px' )
 
  +
local link = args['link'] or args[1]
:css( 'margin-right', '6px' )
 
  +
local name = args['text'] or args[1]
:css( 'width', size )
 
  +
:wikitext( '<div style="box-shadow:0px 0px 2px 4px ' .. color({ border }) .. '>[[' .. icon .. '|' .. size .. '|link=' .. args[1] .. '|' .. args[1] .. ']]</div>[[' .. args[1] .. ']]' )
 
 
-- Try getting data from the cargo table.
else
 
 
local cargo_output = cargo.query('cosmetic_items', 'image, rarity', { where='_pageName="' .. args[1] .. '"', groupBy='_pageID' })[1]
return error( '检查你的输入', 0 )
 
 
if cargo_output then
end
 
 
border = 'cos_' .. string.lower(cargo_output['rarity'])
 
icon = cargo_output['image']
 
end
  +
 
return mw.html.create('div')
 
:attr('class', 'cosmetic-label')
 
:css('margin-left', '6px')
 
:css('margin-right', '6px')
 
:css('width', size)
 
:wikitext('<div style="box-shadow:0px 0px 2px 4px ' .. color({ border }) .. '>[[' .. icon .. '|' .. size .. '|link=' ..link .. '|' .. name .. ']]</div>[[' .. link .. '|' .. name .. ']]')
 
end
 
end
   

2018年3月30日 (五) 15:39的版本

Reality Rift icon
▶️ Planeshift.
该module的文档可以在Template:Cosmetic找到。
You may be forwarded to another wiki language, in case a translation is not available.



local cargo = mw.ext.cargo
local color = require('Module:Color')._main
local getArgs = require('Module:Arguments').main
local p = {}

function p.main()
  local args = getArgs()
  return p._main(args)
end

function p._main(args)
  assert(args[1], '没有输入饰品')

  local icon = 'File:Cosmetic icon ' .. args[1] .. '.png'
  local border = 'cos_common'
  local size = args['userparam'] or args[2] or '100px'
  local link = args['link'] or args[1]
  local name = args['text'] or args[1]

  -- Try getting data from the cargo table.
  local cargo_output = cargo.query('cosmetic_items', 'image, rarity', { where='_pageName="' .. args[1] .. '"', groupBy='_pageID' })[1]
  if cargo_output then
    border = 'cos_' .. string.lower(cargo_output['rarity'])
    icon = cargo_output['image']
  end

  return mw.html.create('div')
    :attr('class', 'cosmetic-label')
    :css('margin-left', '6px')
    :css('margin-right', '6px')
    :css('width', size)
    :wikitext('<div style="box-shadow:0px 0px 2px 4px ' .. color({ border }) .. '>[[' .. icon .. '|' .. size .. '|link=' ..link .. '|' .. name .. ']]</div>[[' .. link .. '|' .. name .. ']]')
end

return p