3,510
edits
No edit summary |
(Sortable tables, switched to mw.html) |
||
Line 226: | Line 226: | ||
-- Build the table | -- Build the table | ||
local resultTable = | local resultTable = mw.html.create('table') | ||
resultTable:addClass('wikitable'):addClass('sortable') | |||
resultTable:tag('tr'):addClass('headerRow-0') | |||
:tag('th'):wikitext('Point of Interest'):done() | |||
:tag('th'):wikitext('X'):done() | |||
:tag('th'):wikitext('Y'):done() | |||
:tag('th'):wikitext('Requirements'):done() | |||
:tag('th'):wikitext('Discovery Rewards'):done() | |||
for _, POI in ipairs(POIs) do | for _, POI in ipairs(POIs) do | ||
local X, Y = p.convertAxialToXY(POI.coords) | local X, Y = p.convertAxialToXY(POI.coords) | ||
local tr = mw.html.create('tr') | |||
tr:tag('td'):wikitext(Icons.Icon({POI.name, type='poi'})) | |||
tr:tag('td'):wikitext(X) | |||
tr:tag('td'):wikitext(Y) | |||
tr:tag('td'):wikitext(table.concat(p._getPOIRequirements(POI), '<br/>')) | |||
tr:tag('td'):wikitext(table.concat(p._getDiscoveryRewards(POI), '<br/>')) | |||
resultTable:node(tr) | |||
end | end | ||
return tostring(resultTable) | |||
return | |||
end | end | ||