Line 188: |
Line 188: |
| equipHeader = '<th style="white-space: nowrap; {{border-radius|12px 12px 12px 12px}} background-color: #efe6d7; color: #a3965c; vertical-align: baseline;">Equipment</th>' | | equipHeader = '<th style="white-space: nowrap; {{border-radius|12px 12px 12px 12px}} background-color: #efe6d7; color: #a3965c; vertical-align: baseline;">Equipment</th>' |
| equipStyle = '<td style="white-space: nowrap; text-align: center; vertical-align: baseline;">' | | equipStyle = '<td style="white-space: nowrap; text-align: center; vertical-align: baseline;">' |
| + | end |
| + | |
| + | local numRows = 4 |
| + | -- ship ID for Musashi Kai 2 |
| + | if shipNum == 400 then |
| + | numRows = 5 |
| end | | end |
| | | |
− | local equip = {'<tr>', '<tr>', '<tr>', '<tr>'} | + | local equipTable = '' |
− | for i = 1, 4, 1 do | + | for i = 1, numRows, 1 do |
| + | local equipRow = '<tr>' |
| if shipmodule.data[shipNum]["aircraft"] ~= "" then | | if shipmodule.data[shipNum]["aircraft"] ~= "" then |
| if shipmodule.data[shipNum]["aircraft"][i] ~= nil then | | if shipmodule.data[shipNum]["aircraft"][i] ~= nil then |
− | equip[i] = equip[i] .. planeStyle .. shipmodule.data[shipNum]["aircraft"][i] .. '</td>' .. equipStyle | + | equipRow = equipRow .. planeStyle .. shipmodule.data[shipNum]["aircraft"][i] .. '</td>' .. equipStyle |
| else | | else |
− | equip[i] = equip[i] .. planeStyle .. '</td>' .. equipStyle | + | equipRow = equipRow .. planeStyle .. '</td>' .. equipStyle |
| end | | end |
| if shipmodule.data[shipNum]["equip"] ~= "" then | | if shipmodule.data[shipNum]["equip"] ~= "" then |
| if shipmodule.data[shipNum]["equip"][i] == "" or shipmodule.data[shipNum]["equip"][i] == "Unequipped" then | | if shipmodule.data[shipNum]["equip"][i] == "" or shipmodule.data[shipNum]["equip"][i] == "Unequipped" then |
− | equip[i] = equip[i] .. '-Unequipped-</td></tr>' | + | equipRow = equipRow .. '-Unequipped-</td></tr>' |
| elseif shipmodule.data[shipNum]["equip"][i] == nil then | | elseif shipmodule.data[shipNum]["equip"][i] == nil then |
− | equip[i] = equip[i] .. '\'\'-Locked-\'\'</td></tr>' | + | equipRow = equipRow .. '\'\'-Locked-\'\'</td></tr>' |
| else | | else |
| if string.find(shipmodule.data[shipNum]["equip"][i], "%★") then | | if string.find(shipmodule.data[shipNum]["equip"][i], "%★") then |
| a,b = string.match(shipmodule.data[shipNum]["equip"][i], "^(.+)★(.+)$") | | a,b = string.match(shipmodule.data[shipNum]["equip"][i], "^(.+)★(.+)$") |
− | equip[i] = equip[i] .. '[[' .. a .. '|' .. a .. '★' .. b .. ']]</td></tr>' | + | equipRow = equipRow .. '[[' .. a .. '|' .. a .. '★' .. b .. ']]</td></tr>' |
| else | | else |
− | equip[i] = equip[i] .. '[[' .. shipmodule.data[shipNum]["equip"][i] .. ']]</td></tr>' | + | equipRow = equipRow .. '[[' .. shipmodule.data[shipNum]["equip"][i] .. ']]</td></tr>' |
| end | | end |
| end | | end |
| else | | else |
− | equip[i] = equip[i] .. '\'\'-Locked-\'\'</td></tr>' | + | equipRow = equipRow .. '\'\'-Locked-\'\'</td></tr>' |
| end | | end |
| else | | else |
− | equip[i] = equip[i] .. equipStyle | + | equipRow = equipRow .. equipStyle |
| if shipmodule.data[shipNum]["equip"] ~= "" then | | if shipmodule.data[shipNum]["equip"] ~= "" then |
| if shipmodule.data[shipNum]["equip"][i] == "" or shipmodule.data[shipNum]["equip"][i] == "Unequipped" then | | if shipmodule.data[shipNum]["equip"][i] == "" or shipmodule.data[shipNum]["equip"][i] == "Unequipped" then |
− | equip[i] = equip[i] .. '-Unequipped-</td></tr>' | + | equipRow = equipRow .. '-Unequipped-</td></tr>' |
| elseif shipmodule.data[shipNum]["equip"][i] == nil then | | elseif shipmodule.data[shipNum]["equip"][i] == nil then |
− | equip[i] = equip[i] .. '\'\'Locked\'\'</td></tr>' | + | equipRow = equipRow .. '\'\'Locked\'\'</td></tr>' |
| else | | else |
| if string.find(shipmodule.data[shipNum]["equip"][i], "%★") then | | if string.find(shipmodule.data[shipNum]["equip"][i], "%★") then |
| a,b = string.match(shipmodule.data[shipNum]["equip"][i], "^(.+)★(.+)$") | | a,b = string.match(shipmodule.data[shipNum]["equip"][i], "^(.+)★(.+)$") |
− | equip[i] = equip[i] .. '[[' .. a .. '|' .. a .. '★' .. b .. ']]</td></tr>' | + | equipRow = equipRow .. '[[' .. a .. '|' .. a .. '★' .. b .. ']]</td></tr>' |
| else | | else |
− | equip[i] = equip[i] .. '[[' .. shipmodule.data[shipNum]["equip"][i] .. ']]</td></tr>' | + | equipRow = equipRow .. '[[' .. shipmodule.data[shipNum]["equip"][i] .. ']]</td></tr>' |
| end | | end |
| end | | end |
| else | | else |
− | equip[i] = equip[i] .. '\'\'Locked\'\'</td></tr>' | + | equipRow = equipRow .. '\'\'Locked\'\'</td></tr>' |
| end | | end |
| end | | end |
| + | equipTable = equipTable .. equipRow |
| end | | end |
− | return '<table style="width: 100%">' .. equipHeader .. equip[1] .. equip[2] .. equip[3] .. equip[4] .. '</table>' | + | return '<table style="width: 100%">' .. equipHeader .. equipTable .. '</table>' |
| end | | end |
| | | |