2,875
edits
No edit summary |
No edit summary |
||
Line 1,170: | Line 1,170: | ||
local tableRoot = root:tag('table') | local tableRoot = root:tag('table') | ||
tableRoot:addClass('wikitable sortable stickyHeader') | tableRoot:addClass('wikitable sortable stickyHeader') | ||
-- Header | -- Header rows | ||
local headerRow = tableRoot:tag('tr'):addClass('headerRow-0') | local headerRow = tableRoot:tag('tr'):addClass('headerRow-0') | ||
headerRow:tag('th'):attr('rowspan', 2):attr('colspan', 2):wikitext('Constellation') | headerRow:tag('th'):attr('rowspan', 2):attr('colspan', 2):wikitext('Constellation') | ||
Line 1,179: | Line 1,179: | ||
-- Modifiers headers | -- Modifiers headers | ||
local modHeadersRow = tableRoot:tag('tr'):addClass('headerRow-1') | |||
for _, modType in ipairs(modTypes) do | for _, modType in ipairs(modTypes) do | ||
if modType.inUse then | if modType.inUse then | ||
modHeadersRow:tag('th'):attr('colspan', 2):wikitext(modType.name .. ' Stars') | |||
end | end | ||
end | end | ||
Line 1,201: | Line 1,194: | ||
table.insert(skillIconArray, Icons.Icon({Constants.getSkillName(skillID), type='skill'})) | table.insert(skillIconArray, Icons.Icon({Constants.getSkillName(skillID), type='skill'})) | ||
end | end | ||
-- Calculate maximum rows needed | |||
local maxRows = 1 | local maxRows = 1 | ||
for _, modTypeData in pairs(modData) do | for _, modTypeData in pairs(modData) do | ||
Line 1,206: | Line 1,201: | ||
end | end | ||
local row = tableRoot:tag('tr') | -- Iterate through rows | ||
for rowIdx = 1, maxRows do | |||
local row = tableRoot:tag('tr') | |||
if rowIdx == 1 then | |||
row:tag('td'):attr('rowspan', maxRows):attr('data-sort-value', name):attr('id', name):wikitext(Icons.Icon({ name, type='constellation', notext=true })) | |||
row:tag('td'):attr('rowspan', maxRows):wikitext(Icons.getDLCColumnIcon(cons.id) .. name) | |||
row:tag('td'):attr('rowspan', maxRows):addClass('text-right'):wikitext(cons.level) | |||
row:tag('td'):attr('rowspan', maxRows):addClass('text-right'):wikitext(cons.baseExperience) | |||
row:tag('td'):attr('rowspan', maxRows):wikitext(table.concat(skillIconArray, '<br/>')) | |||
else | |||
row:tag('td') -- Empty cell to maintain structure | |||
row:tag('td') | |||
row:tag('td') | |||
row:tag('td') | |||
row:tag('td') | |||
end | |||
-- Modifiers data | |||
for _, modType in ipairs(modTypes) do | for _, modType in ipairs(modTypes) do | ||
if modType.inUse then | if modType.inUse then | ||
local masteryLevel = modType.levels[rowIdx] | local masteryLevel = modType.levels[rowIdx] | ||
local rowModData = modData[modType.modKey][rowIdx] | local rowModData = modData[modType.modKey][rowIdx] | ||
local | local cell1 = row:tag('td') | ||
local cell2 = row:tag('td') | |||
if masteryLevel ~= nil and rowModData ~= nil then | if masteryLevel ~= nil and rowModData ~= nil then | ||
cell1:addClass('text-right'):wikitext(masteryLevel) | |||
cell2:wikitext(Modifiers.getModifiersText(rowModData, false, false, 10)) | |||
else | else | ||
cell1:attr('colspan', 2):addClass('table-na'):wikitext(' ') | |||
end | end | ||
end | end | ||
end | end | ||
end | end |
edits