Line 92: |
Line 92: |
| end | | end |
| | | |
− | function NodeInfo:insert_item(node, formation, fleet, as, tags) | + | function NodeInfo:insert_item(node, formation, fleet, as, tags, as_complete) |
− | local air_parity = string.format("%.1d", math.ceil((2./3.) * as)) | + | local air_parity = (as_complete or as > 0) and string.format("%.1d", math.ceil((2./3.) * as)) or "??" |
− | local air_superiority = string.format("%.1d", math.ceil(as * (3 / 2))) | + | local air_superiority = (as_complete or as > 0) and string.format("%.1d", math.ceil(as * (3 / 2))) or "??" |
− | local air_supremacy = tostring(as * 3) | + | local air_supremacy = (as_complete or as > 0) and tostring(as * 3) or "??" |
− | local air_string = 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) |
| table.insert(self._items, { | | table.insert(self._items, { |
| node = node, | | node = node, |
Line 118: |
Line 119: |
| local node, formation = nil, nil | | local node, formation = nil, nil |
| local fleet = {} | | local fleet = {} |
− | local as_rating = 0 | + | local as_rating, as_complete = 0, true |
| | | |
| local tags = {} | | local tags = {} |
Line 125: |
Line 126: |
| if item_key == "-" then | | if item_key == "-" then |
| if mode == 6 then --We're at a break and have built a full row; time to insert it | | if mode == 6 then --We're at a break and have built a full row; time to insert it |
− | self:insert_item(node, formation, table.concat(fleet, " "), as_rating, tags) | + | self:insert_item(node, formation, table.concat(fleet, " "), as_rating, tags, as_complete) |
| end | | end |
| | | |
Line 190: |
Line 191: |
| | | |
| table.insert(fleet, ShipBattleCardKai:get{ship = ship, caption = ship:name(), link = ship:link(), flagship = #fleet == 0}) | | table.insert(fleet, ShipBattleCardKai:get{ship = ship, caption = ship:name(), link = ship:link(), flagship = #fleet == 0}) |
− |
| + | |
− | if ship:air_power() then | + | local ship_air_power = ship:air_power() |
− | as_rating = as_rating + ship:air_power() | + | if ship_air_power then |
| + | as_rating = as_rating + ship_air_power |
| + | else |
| + | as_complete = false |
| end | | end |
| end | | end |
Line 198: |
Line 202: |
| end | | end |
| if mode == 6 then | | if mode == 6 then |
− | self:insert_item(node, formation, table.concat(fleet, " "), as_rating, tags) | + | self:insert_item(node, formation, table.concat(fleet, " "), as_rating, tags, as_complete) |
| end | | end |
| end | | end |