[checked revision] | [checked revision] |
No edit summary |
No edit summary |
||
(One intermediate revision by the same user not shown) | |||
Line 1: | Line 1: | ||
local util_esports = require('Module:EsportsUtil') |
local util_esports = require('Module:EsportsUtil') |
||
local util_text = require('Module:TextUtil') |
local util_text = require('Module:TextUtil') |
||
− | local Champion = require('Module: |
+ | local Champion = require('Module:Champion') |
− | local |
+ | local Region = require('Module:Region') |
− | local |
+ | local Country = require('Module:Country') |
local m_team = require('Module:Team') |
local m_team = require('Module:Team') |
||
local i18n = require('Module:i18nUtil') |
local i18n = require('Module:i18nUtil') |
||
Line 12: | Line 12: | ||
local teamstyle = teamstyle or (data.player and 'onlyimagelinkedshort') or 'rightshortlinked' |
local teamstyle = teamstyle or (data.player and 'onlyimagelinkedshort') or 'rightshortlinked' |
||
if data.region then |
if data.region then |
||
− | tbl:wikitext( |
+ | tbl:wikitext(Region(data.region):image()) |
end |
end |
||
if data.flag then |
if data.flag then |
||
− | tbl:wikitext( |
+ | tbl:wikitext(Country(data.flag):image()) |
end |
end |
||
if data.team and (data.team ~= 'TBD' or not data.seed) then |
if data.team and (data.team ~= 'TBD' or not data.seed) then |
||
Line 27: | Line 27: | ||
end |
end |
||
if data.playerflag then |
if data.playerflag then |
||
− | tbl:wikitext( |
+ | tbl:wikitext(Country(data.playerflag):image()) |
end |
end |
||
if data.player then |
if data.player then |
Latest revision as of 13:58, 14 August 2020
Documentation for this module may be created at Module:Bracket/Wiki/doc
local util_esports = require('Module:EsportsUtil')
local util_text = require('Module:TextUtil')
local Champion = require('Module:Champion')
local Region = require('Module:Region')
local Country = require('Module:Country')
local m_team = require('Module:Team')
local i18n = require('Module:i18nUtil')
local p = {}
function p.teamDisplay(tbl, data, teamstyle)
local teamstyle = teamstyle or (data.player and 'onlyimagelinkedshort') or 'rightshortlinked'
if data.region then
tbl:wikitext(Region(data.region):image())
end
if data.flag then
tbl:wikitext(Country(data.flag):image())
end
if data.team and (data.team ~= 'TBD' or not data.seed) then
tbl:wikitext(m_team[teamstyle](data.team))
elseif data.seed then
-- a description like "Seed 1" that should only display before a team is known
tbl:wikitext(i18n.print('seed', data.seed))
end
if data.champion then
tbl:wikitext(Champion(data.champion):image())
end
if data.playerflag then
tbl:wikitext(Country(data.playerflag):image())
end
if data.player then
tbl:wikitext(' ',util_esports.playerLinked(data.player))
end
if data.players then
tbl:wikitext(' ',util_esports.playersLinked(data.players))
end
if data.literal then
tbl:wikitext(data.literal)
end
if data.footnoten then
tbl:tag('sup'):wikitext(data.footnoten)
end
end
return p