Leaguepedia | League of Legends Esports Wiki
[checked revision][checked revision]
((via Mediawiker ST3))
Ispoonz (talk | contribs)
No edit summary
(40 intermediate revisions by one other user not shown)
Line 1: Line 1:
 
local util_args = require('Module:ArgsUtil')
 
local util_args = require('Module:ArgsUtil')
local util_table = require('Module:TableUtil')
 
 
local util_text = require('Module:TextUtil')
 
local util_text = require('Module:TextUtil')
 
local i18n = require('Module:i18nUtil')
 
local i18n = require('Module:i18nUtil')
   
  +
local h = {}
 
local p = {
 
local p = {
 
players_per_team = 5,
 
players_per_team = 5,
Line 11: Line 11:
 
['2'] = 'Red'
 
['2'] = 'Red'
 
},
 
},
years = { 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019 },
+
years = { 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 },
 
store_player_league_history = true, -- do we store to PlayerLeagueHistory from InfoboxPlayer? will prevent needing to sync a normally-unneeded dependency
 
store_player_league_history = true, -- do we store to PlayerLeagueHistory from InfoboxPlayer? will prevent needing to sync a normally-unneeded dependency
 
}
 
}
   
 
function p.linkPatch(str)
 
function p.linkPatch(str)
 
if not str then return nil end
return util_text.intLink(('Patch %s'):format(str), str)
+
return util_text.intLink(p.patchPage(str), str)
 
end
 
end
   
function p.onProcessMatchListTabRow(row, i, j, args, tab)
+
function p.patchPage(str)
  +
return ('Patch %s'):format(str)
-- add patch as a table caption
 
util_table.initTable(tab, 'patchinfo', { patches = {}, hotfixes = {}, disabled = {} })
 
if not row.Patch then return true end
 
util_table.initDict(tab.patchinfo.patches, row.Patch)
 
if row.Hotfix then
 
util_table.initDict(tab.patchinfo.hotfixes, row.Hotfix)
 
end
 
util_table.merge(tab.patchinfo.disabled, util_text.split(row.Disabled))
 
return true
 
end
 
 
function p.onMatchListGenerateCaption(tab)
 
local patches = util_table.concat(tab.patchinfo.patches, ', ', p.linkPatch)
 
if patches then
 
tab.caption = i18n.print('patchCaption', patches)
 
end
 
return true
 
 
end
 
end
   

Revision as of 21:09, 17 January 2022

Edit the documentation or categories for this module.
local util_args = require('Module:ArgsUtil')
local util_text = require('Module:TextUtil')
local i18n = require('Module:i18nUtil')

local h = {}
local p = {
	players_per_team = 5,
	side_names = {
		'Blue', 'Red',
		['1'] = 'Blue',
		['2'] = 'Red'
	},
	years = { 2010, 2011, 2012, 2013, 2014, 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022 },
	store_player_league_history = true, -- do we store to PlayerLeagueHistory from InfoboxPlayer? will prevent needing to sync a normally-unneeded dependency
}

function p.linkPatch(str)
	if not str then return nil end
	return util_text.intLink(p.patchPage(str), str)
end

function p.patchPage(str)
	return ('Patch %s'):format(str)
end

return p