Line 160: |
Line 160: |
| -- rows | | -- rows |
| for key, row in pairs(tbl.rows) do | | for key, row in pairs(tbl.rows) do |
− | res = res .. table_format.row | + | if row.rare then |
− | res = res .. format{table_format.type_cell, type = row.type}
| + | res = res .. table_format.row |
− | res = res .. format{
| + | res = res .. format{table_format.type_cell, type = row.type} |
− | row.rare and table_format.rare_ship_cell or table_format.ship_cell, | + | res = res .. format{ |
− | ship = row.ship
| + | table_format.rare_ship_cell, |
− | }
| + | ship = row.ship |
− | for _, node in pairs(tbl.nodes) do
| + | } |
− | local node = row.nodes[node.name]
| + | for _, node in pairs(tbl.nodes) do |
− | res = res .. (node and format{
| + | local node = row.nodes[node.name] |
− | table_format.node_cell,
| + | res = res .. (node and format{ |
− | color = node.color,
| + | table_format.node_cell, |
− | diff = node.diff
| + | color = node.color, |
− | } or table_format.empty_cell)
| + | diff = node.diff |
| + | } or table_format.empty_cell) |
| + | end |
| + | end |
| + | end |
| + | for key, row in pairs(tbl.rows) do |
| + | if not row.rare then |
| + | res = res .. table_format.row |
| + | res = res .. format{table_format.type_cell, type = row.type} |
| + | res = res .. format{ |
| + | table_format.ship_cell, |
| + | ship = row.ship |
| + | } |
| + | for _, node in pairs(tbl.nodes) do |
| + | local node = row.nodes[node.name] |
| + | res = res .. (node and format{ |
| + | table_format.node_cell, |
| + | color = node.color, |
| + | diff = node.diff |
| + | } or table_format.empty_cell) |
| + | end |
| end | | end |
| end | | end |