2,873
edits
(Default icon size) |
No edit summary |
||
Line 299: | Line 299: | ||
end | end | ||
local | local html = mw.html.create('table') | ||
:addClass('wikitable, sortable, stickyHeader') | |||
html:tag('tr'):addClass('headerRow-0') | |||
:tag('th'):wikitext('Familiar 1') | |||
:attr('colspan', 2) | |||
:tag('th'):wikitext('Familiar 2') | |||
:attr('colspan', 2) | |||
:tag('th'):wikitext('DLC') | |||
:tag('th'):wikitext('Effect') | |||
for i, rowItem in ipairs(rowArray) do | for i, rowItem in ipairs(rowArray) do | ||
local DLCIcon = Icons.getExpansionIcon(rowItem.FamID1) | |||
local row = html:tag('tr') | |||
row:tag('td'):wikitext(Icons.Icon({rowItem.Fam1, type='item', notext=true})) | |||
:attr('data-sort-value', rowItem.Fam1) | |||
row:tag('td'):wikitext(Icons.Icon({rowItem.Fam1, type='item', noicon=true})) | |||
if rowItem.Fam2 ~= nil then | if rowItem.Fam2 ~= nil then | ||
-- If Fam1 has no DLC, try setting it for Fam2 | |||
if DLCIcon == nil or DLCIcon == '' then | |||
DLCIcon = Icons.getExpansionIcon(rowItem.FamID2) | |||
end | |||
row:tag('td'):wikitext(Icons.Icon({rowItem.Fam2, type='item', notext=true})) | |||
:attr('data-sort-value', rowItem.Fam2) | |||
row:tag('td'):wikitext(Icons.Icon({rowItem.Fam2, type='item', noicon=true})) | |||
else | else | ||
row:tag('td'):tag('td') | |||
end | end | ||
-- If both familiars have no DLC, default to melvor icon. | |||
if DLCIcon == nil or DLCIcon == '' then | |||
DLCIcon = Icons.Melvor() | |||
end | |||
-- As of 06/07/2024, no synergies exist that use two DLCs | |||
row:tag('td'):wikitext(DLCIcon) | |||
:css('text-align', 'center') | |||
row:tag('td'):wikitext(rowItem.Descrip or ' ') | |||
end | end | ||
return tostring(html) | |||
end | end | ||
edits