| Line 68: |
Line 68: |
| | -- TODO: japanese tooltips | | -- TODO: japanese tooltips |
| | ship_cell = '|[[${ship}|<span style="color:${color};">${ship}</span>]]\n', | | ship_cell = '|[[${ship}|<span style="color:${color};">${ship}</span>]]\n', |
| − | node_cell = '|style="background-color:#${color};"|${diff}\n', | + | node_cell = '|style="background-color:#${background_color};color:${color}"|${diff}\n', |
| | empty_cell = '|\n', | | empty_cell = '|\n', |
| | footer = '|}\n', | | footer = '|}\n', |
| Line 81: |
Line 81: |
| | | | |
| | local args_grammar = { | | local args_grammar = { |
| − | node = '^%s*(%w-)%s*$', | + | node = '^%s*(%w-)%s*$', |
| − | comma_list = '[^,]+', | + | comma_list = '[^,]+', |
| − | ship_and_nodes = '^%s*(.-)%s*:%s*(.-)%s*$', | + | ship_and_nodes = '^%s*(.-)%s*:%s*(.-)%s*$', |
| − | just_node = '^%s*(%w-)%s*$', | + | just_node = '^%s*(%w-)%s*$', |
| − | node_and_diff = '^%s*(%w-)%s*/%s*(%S-)%s*$', | + | node_and_diff = '^%s*(%w-)%s*/%s*(%S-)%s*$', |
| | node_diff_tooltip = '^%s*(%w-)%s*/%s*(%S-)%s*{(.-)}%s*$', | | node_diff_tooltip = '^%s*(%w-)%s*/%s*(%S-)%s*{(.-)}%s*$', |
| | + | node_diff_tooltip_s = '^%s*(%w-)%s*/%s*(%S-)%s*{(.-)}%s*S%s*$', |
| | -- TODO: | | -- TODO: |
| | -- * just_node_tooltip | | -- * just_node_tooltip |
| Line 177: |
Line 178: |
| | end | | end |
| | for node_arg in string.gmatch(nodes, args_grammar.comma_list) do | | for node_arg in string.gmatch(nodes, args_grammar.comma_list) do |
| − | local node, diff, tooltip = node_arg:match(args_grammar.node_diff_tooltip) | + | local s_only = false |
| | + | local node, diff, tooltip = node_arg:match(args_grammar.node_diff_tooltip_s) |
| | + | if not node then |
| | + | node, diff, tooltip = node_arg:match(args_grammar.node_diff_tooltip) |
| | + | else |
| | + | s_only = true |
| | + | end |
| | if not node then | | if not node then |
| | node, diff = node_arg:match(args_grammar.node_and_diff) | | node, diff = node_arg:match(args_grammar.node_and_diff) |
| Line 196: |
Line 203: |
| | diff = diff_names[diff], | | diff = diff_names[diff], |
| | tooltip = tooltip, | | tooltip = tooltip, |
| | + | s_only = s_only, |
| | } | | } |
| | end | | end |
| Line 233: |
Line 241: |
| | local node = row.nodes[node.name] | | local node = row.nodes[node.name] |
| | add(node and format{ | | add(node and format{ |
| − | table_format.node_cell, color = node.color, diff = node.tooltip and Formatting:tooltip(node.diff, node.tooltip) or node.diff | + | table_format.node_cell, |
| | + | background_color = node.color, |
| | + | color = node.s_only and 'red' or '', |
| | + | diff = node.tooltip and Formatting:tooltip(node.diff, node.tooltip) or node.diff |
| | } or table_format.empty_cell) | | } or table_format.empty_cell) |
| | end | | end |