Changes

add bonus section
Line 23: Line 23:  
|-
 
|-
 
| colspan="2" style="text-align: center; background-color: LightSkyBlue;" | '''Refittable Class'''
 
| colspan="2" style="text-align: center; background-color: LightSkyBlue;" | '''Refittable Class'''
${compatibility_details}
+
${compatibility_details}${bonus_details}
 
|}]],
 
|}]],
 +
    _bonus_header = [[
 +
|-
 +
| colspan="2" style="text-align: center; background-color: LightSkyBlue;" | '''Bonus''']],
 +
    _bonus_row = [=[|-
 +
| style="width: 190px; text-align: center;" | [[${ship}]]
 +
| style="width: 190px; text-align: center;" | ${stats}]=],
 
--|-
 
--|-
 
--| colspan="2" style="text-align: center; padding: 0px;" | <div class="mw-collapsible mw-collapsed">
 
--| colspan="2" style="text-align: center; padding: 0px;" | <div class="mw-collapsible mw-collapsed">
Line 90: Line 96:  
"crafting",
 
"crafting",
 
"compatibility_details",
 
"compatibility_details",
 +
"bonus_details",
 
},
 
},
 
}
 
}
Line 319: Line 326:  
end
 
end
 
self._vars.compatibility_details = table.concat(result, "\n")
 
self._vars.compatibility_details = table.concat(result, "\n")
 +
end
 +
 +
function EquipmentInfoKai:bonus_details()
 +
    local result = { self._bonus_header }
 +
    for ship, stats in pairs(self._equipment._bonus or {}) do
 +
        table.insert(result, format{
 +
            self._bonus_row,
 +
            ship = ship,
 +
            stats = Formatting:format_stat_bonuses(stats)
 +
        })
 +
    end
 +
    self._vars.bonus_details = #result > 1 and table.concat(result, "\n") or ""
 
end
 
end
  
cssedit, gkautomate
6,928

edits