Line 100: |
Line 100: |
| | | |
| function NodeInfo:insert_item(node, formation, fleet, as, tags, as_complete) | | function NodeInfo:insert_item(node, formation, fleet, as, tags, as_complete) |
| + | --[[ |
| + | -- Can give weird results when major contributors to air power are unknown |
| + | -- TODO: use tooltips with explanations instead |
| local air_parity = (as_complete or as > 0) and string.format("%.1d", math.ceil((2./3.) * as)) or "??" | | local air_parity = (as_complete or as > 0) and string.format("%.1d", math.ceil((2./3.) * as)) or "??" |
| local air_superiority = (as_complete or as > 0) and string.format("%.1d", math.ceil(as * (3 / 2))) or "??" | | local air_superiority = (as_complete or as > 0) and string.format("%.1d", math.ceil(as * (3 / 2))) or "??" |
Line 105: |
Line 108: |
| local air_string = not as_complete and as > 0 and (air_parity .. "+/" .. air_superiority .. "+/" .. air_supremacy .. "+") | | local air_string = not as_complete and as > 0 and (air_parity .. "+/" .. air_superiority .. "+/" .. air_supremacy .. "+") |
| or (air_parity .. "/" .. air_superiority .. "/" .. air_supremacy) | | or (air_parity .. "/" .. air_superiority .. "/" .. air_supremacy) |
| + | --]] |
| + | local air_parity = as_complete and string.format("%.1d", math.ceil((2./3.) * as)) or "??" |
| + | local air_superiority = as_complete and string.format("%.1d", math.ceil(as * (3 / 2))) or "??" |
| + | local air_supremacy = as_complete and tostring(as * 3) or "??" |
| + | local air_string = air_parity .. "/" .. air_superiority .. "/" .. air_supremacy |
| table.insert(self._items, { | | table.insert(self._items, { |
| node = node, | | node = node, |
− | formation = formation,
| + | formation = formation, |
− | fleet = fleet,
| + | fleet = fleet, |
− | as = air_string,
| + | as = air_string, |
− | tags = tags,
| + | tags = tags, |
− | })
| + | }) |
| end | | end |
| | | |