Dota 2 Wiki
Advertisement
Dota 2 Wiki
20,118
pages

Documentation for Module:Talents Jump to code ↴ [ edit | purge ]

Reality Rift icon.png
▶️ Planeshift.
The documentation for this module can be found at Template:Talents.
You may be forwarded to another wiki language, in case a translation is not available.


Dependencies

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

local i18n = {
  talents_article = 'Talents',
  table_title = 'Hero Talents',
}


function p.main(frame)
  local args = get_args(frame, {
    wrappers = {
      'Template:Talents'
    }
  })
  
  local talents = mw.html.create('table')
    :addClass('wikitable')
    :css('text-align', 'center')
    :css('margin-right', '15px')
    -- Add the table header.
    :tag('tr')
      :tag('th')
        :attr('colspan', 3)
        :css('height', '40px')
        :css('background-color', '#0C2A5A')
        :wikitext(string.format('[[%s|<span style="color:white; font-size:14pt;">%s</span>]]', i18n.talents_article, i18n.table_title))
        :done()
      :done()
      :newline()

  for i=4,1,-1 do
    talents
      :tag('tr')
        :tag('td')
          :css('width', '240px')
          :wikitext(frame:expandTemplate({ title = 'Talent class', args = { args['t'..i..'left'], args['v'..i..'left'] }}))
          :done()
        :tag('th')
          :css('padding', '10px')
          :css('background-color', string.format('hsl(217, 76%%, %i%%)', 60-10*i))
          :css('font-size', '13pt')
          :css('color', 'white')
          :wikitext(5+5*i)
          :done()
        :tag('td')
          :css('width', '240px')
          :wikitext(frame:expandTemplate({ title = 'Talent class', args = { args['t'..i..'right'], args['v'..i..'right'] }}))
          :done()
        :done()
        :newline()
  end

  return talents
end


return p
Advertisement