Changes

ship level cap 175 -> 180
Line 2: Line 2:  
local Ship = require('Module:Ship')
 
local Ship = require('Module:Ship')
 
local ShipCardKai = require('Module:ShipCardKai')
 
local ShipCardKai = require('Module:ShipCardKai')
local ResourceIcons = require('Module:ResourceIcons')
+
local ResourceIcons = require('Module:Data/Asset')
local StatIcons = require('Module:StatIcons')
+
local StatIcons = require('Module:Data/Asset')
 
local Formatting = require('Module:Formatting')
 
local Formatting = require('Module:Formatting')
local format = require('Module:StringInterpolation').format
+
local EquipmentLink = require('Module:EquipmentLink')
 +
local format = require('Module:Core').format
    
local ShipInfoKai = BaseData{
 
local ShipInfoKai = BaseData{
_catbomb = "Catbomb.png|300px",
   
_unbuildable = "''Unbuildable''",
 
_unbuildable = "''Unbuildable''",
 
_remodel_level = "'''Remodel Level'''",
 
_remodel_level = "'''Remodel Level'''",
Line 21: Line 21:  
_localized_name_template = "<br />''${localized_name}''",
 
_localized_name_template = "<br />''${localized_name}''",
 
_kekkon_max_template = "Maximum after marriage: ${value}",
 
_kekkon_max_template = "Maximum after marriage: ${value}",
 +
_kekkon_template = "After marriage: ${value}; Upper bound: ${max}",
 +
_remodel_level_stat_value_template = "At remodel level: ${value}",
 +
_simple_nick_template = " (''${nick}'')",
 
_nick_template = " (''${nick} ${japanese_nick}'')",
 
_nick_template = " (''${nick} ${japanese_nick}'')",
 
_overridden_category_template = "[[Category:Pages that override data modules]]",
 
_overridden_category_template = "[[Category:Pages that override data modules]]",
Line 55: Line 58:  
"slot_details",
 
"slot_details",
 
"gun_fit_properties",
 
"gun_fit_properties",
 +
"improvement",
 
},
 
},
 
_slot_template = [[|- align=center style="background-color: whitesmoke; line-height: 1.1;"
 
_slot_template = [[|- align=center style="background-color: whitesmoke; line-height: 1.1;"
 
| style="width: 36px; height: 36px; background-color: ${color};${extra_style}" | ${icon}
 
| style="width: 36px; height: 36px; background-color: ${color};${extra_style}" | ${icon}
| colspan="4" style="width: 190px;" | ${equipment}
+
| colspan="4" style="width: 190px;" | ${equipment}${stars}
 
| style="width: 50px;" | ${slot_size}
 
| style="width: 50px;" | ${slot_size}
 
]],
 
]],
_template = [[{|class="${table_class}" id="${table_id}" style="border: 1px solid darkgray; width: 320px; background-color: #fafafa; float: ${float};"
+
_template = [[{|class="${table_class}" id="${table_id}" style="width: 320px; float: ${float};"
 
|-
 
|-
| colspan="6" style="position: relative; text-align: center; background-color: ${top_bg_color};${top_extra_style}" title="${rarity}" | <div style="position: absolute; right: 5px;">${edit_link}</div>
+
| colspan="6" class="infobox-kai-header-major" style="position: relative; text-align: center; background-color: ${top_bg_color};${top_extra_style}" title="${rarity}" | <div style="position: absolute; right: 5px;">${edit_link}</div>
 
<p><span style="font-size:20px">'''${name}'''</span>${localized_name}</p>
 
<p><span style="font-size:20px">'''${name}'''</span>${localized_name}</p>
 
<div style="font-size:15px">'''No.${id} ${japanese_name}${nick}'''</div>
 
<div style="font-size:15px">'''No.${id} ${japanese_name}${nick}'''</div>
 
<p>'''${class} ${type}'''</p>
 
<p>'''${class} ${type}'''</p>
 
|- style="background-color: whitesmoke;"
 
|- style="background-color: whitesmoke;"
| align=center colspan="6" | ${image}
+
| align=center colspan="6" | <div class="infobox-ship-card">${image}</div>
 
|-
 
|-
| colspan="6" style="text-align: center; background-color: LightSkyBlue;"|'''Statistics'''
+
| colspan="6" class="infobox-kai-header-major" style="text-align: center;"|'''Statistics'''
 +
|- style="background-color:whitesmoke;"
 +
| colspan="2" style="width:88px;white-space:nowrap" | ${icons.hp} ${labels.hp}
 +
| style="width: 66px;white-space:nowrap" | '''${hp}'''
 +
| style="width:88px;white-space:nowrap" | ${icons.firepower} ${labels.firepower}
 +
| colspan="2" style="width:60px;white-space:nowrap" | '''${firepower}'''
 +
|- style="background-color:whitesmoke;"
 +
| colspan="2" style="width:88px;white-space:nowrap" | ${icons.armor} ${labels.armor}
 +
| style="width: 66px;white-space:nowrap" | '''${armor}'''
 +
| style="width:88px;white-space:nowrap" | ${icons.torpedo} ${labels.torpedo}
 +
| colspan="2" style="width:66px;white-space:nowrap" | '''${torpedo}'''
 +
|- style="background-color:whitesmoke;"
 +
| colspan="2" style="width:88px;white-space:nowrap" | ${icons.evasion} ${labels.evasion}
 +
| style="width: 66px;white-space:nowrap" | '''${evasion}'''
 +
| style="width:88px;white-space:nowrap" | ${icons.aa} ${labels.aa}
 +
| colspan="2" style="width:66px;white-space:nowrap" | '''${aa}'''
 +
|- style="background-color:whitesmoke;"
 +
| colspan="2" style="width:88px;white-space:nowrap" | ${icons.aircraft} ${labels.aircraft}
 +
| style="width: 66px;white-space:nowrap" | '''${aircraft}'''
 +
| style="width:88px;white-space:nowrap" | ${icons.asw} ${labels.asw}
 +
| colspan="2" style="width:66px;white-space:nowrap" | '''${asw}'''
 +
|- style="background-color:whitesmoke;"
 +
| colspan="2" style="width:88px;white-space:nowrap" | ${icons.speed} ${labels.speed}
 +
| style="width:66px;white-space:nowrap" | '''${speed}'''
 +
| style="width:88px;white-space:nowrap" | ${icons.los} ${labels.los}
 +
| colspan="2" style="width:66px;white-space:nowrap" | '''${los}'''
 
|- style="background-color: whitesmoke;"
 
|- style="background-color: whitesmoke;"
| colspan="2" style="width: 88px;" | ${icons.hp} ${labels.hp}
+
| colspan="2" style="width:88px;white-space:nowrap" | ${icons.range} ${labels.range}
| style="width: 66px;" | '''${hp}'''
+
| style="width:66px;white-space:nowrap" | '''${range}'''
| style="width: 88px;" | ${icons.firepower} ${labels.firepower}
+
| style="width:88px;white-space:nowrap" | ${icons.luck} ${labels.luck}
| colspan="2" style="width: 60px;" | '''${firepower}'''
+
| colspan="2" style="width:66px;white-space:nowrap" | '''${luck}'''
|- style="background-color: whitesmoke;"
  −
| colspan="2" style="width: 88px;" | ${icons.armor} ${labels.armor}
  −
| style="width: 66px;" | '''${armor}'''
  −
| style="width: 88px;" | ${icons.torpedo} ${labels.torpedo}
  −
| colspan="2" style="width: 66px;" | '''${torpedo}'''
  −
|- style="background-color: whitesmoke;"
  −
| colspan="2" style="width: 88px;" | ${icons.evasion} ${labels.evasion}
  −
| style="width: 66px;" | '''${evasion}'''
  −
| style="width: 88px;" | ${icons.aa} ${labels.aa}
  −
| colspan="2" style="width: 66px;" | '''${aa}'''
  −
|- style="background-color: whitesmoke;"
  −
| colspan="2" style="width: 88px;" | ${icons.aircraft} ${labels.aircraft}
  −
| style="width: 66px;" | '''${aircraft}'''
  −
| style="width: 88px;" | ${icons.asw} ${labels.asw}
  −
| colspan="2" style="width: 66px;" | '''${asw}'''
  −
|- style="background-color: whitesmoke;"
  −
| colspan="2" style="width: 88px;" | ${icons.speed} ${labels.speed}
  −
| style="width: 66px;" | '''${speed}'''
  −
| style="width: 88px;" | ${icons.los} ${labels.los}
  −
| colspan="2" style="width: 66px;" | '''${los}'''
  −
|- style="background-color: whitesmoke;"
  −
| colspan="2" style="width: 88px;" | ${icons.range} ${labels.range}
  −
| style="width: 66px;" | '''${range}'''
  −
| style="width: 88px;" | ${icons.luck} ${labels.luck}
  −
| colspan="2" style="width: 66px;" | '''${luck}'''
   
|-
 
|-
 
| colspan="6" style="text-align: center; background-color: lightgrey;"|'''Resource Consumption'''
 
| colspan="6" style="text-align: center; background-color: lightgrey;"|'''Resource Consumption'''
 
|- style="background-color: whitesmoke;"
 
|- style="background-color: whitesmoke;"
| colspan="2" style="width: 88px;" | ${icons.fuel} Fuel
+
| colspan="2" style="width:88px;white-space:nowrap" | ${icons.fuel} Fuel
| style="width: 66px;" | '''${fuel}'''
+
| style="width:66px;white-space:nowrap" | '''${fuel}'''
| style="width: 88px;" | ${icons.ammo} Ammo
+
| style="width:88px;white-space:nowrap" | ${icons.ammo} Ammo
| colspan="2" style="width: 66px;" | '''${ammo}'''
+
| colspan="2" style="width:66px;white-space:nowrap" | '''${ammo}'''
 
|-
 
|-
| colspan="5" style="text-align: center; background-color: LightSkyBlue;"|${build_remodel_header}
+
| colspan="5" class="infobox-kai-header-major" style="text-align: center;"|${build_remodel_header}
| style="text-align: center; background-color: LightSkyBlue; width: 50px;" | '''Slots'''
+
| class="infobox-kai-header-major" style="text-align: center; width: 50px;" | '''Slots'''
 
|-  style="background-color: whitesmoke;"
 
|-  style="background-color: whitesmoke;"
 
| colspan="5" style="text-align: center;"|${build_remodel_info}
 
| colspan="5" style="text-align: center;"|${build_remodel_info}
 
| align=center style="width: 50px;" |${slots}
 
| align=center style="width: 50px;" |${slots}
 
|-
 
|-
| colspan="5" style="text-align: center; background-color: LightSkyBlue;"|'''Stock Equipment'''
+
| colspan="5" class="infobox-kai-header-major" style="text-align: center;"|'''Stock Equipment'''
| style="text-align: center; background-color: LightSkyBlue; width: 50px;" | '''Space'''
+
| class="infobox-kai-header-major" style="text-align: center; width: 50px;" | '''Space'''
 
${slot_details}|-
 
${slot_details}|-
| colspan="6" style="text-align: center; padding: 0px;" | <div class="mw-collapsible mw-collapsed">
+
| colspan="6" style="text-align: center; padding: 0px;" | <div class="mw-collapsible mw-collapsed infobox-kai-expandable-cells">
<div style="background-color: lightskyblue; text-align: center; margin: 0px;">'''Extra Statistics'''</div>
+
<div class="infobox-kai-header-major" style="text-align: center; margin: 0px;">'''Extra Statistics'''</div>
 
<div class="mw-collapsible-content">
 
<div class="mw-collapsible-content">
${remodel_cost}${reversion_cost}<div style="text-align: center; background-color: lightgrey; margin:2px 0px 2px;">'''Modernization Bonus'''</div>
+
${remodel_cost}${reversion_cost}<div class="infobox-kai-header-minor" style="text-align: center; margin:2px 0px 2px;">'''Modernization Bonus'''</div>
<div style="text-align: center; background-color: whitesmoke; margin:2px 0px 2px;">${modernization}</div>
+
<div style="text-align: center; margin:2px 0px 2px;">${modernization}</div>
<div style="text-align: center; background-color: lightgrey; margin:2px 0px 2px;">'''Scrap Value'''</div>
+
<div class="infobox-kai-header-minor" style="text-align: center; margin:2px 0px 2px;">'''Scrap Value'''</div>
<div style="text-align: center; background-color: whitesmoke; margin:2px 0px 0px;">${scrap}</div>
+
<div style="text-align: center; margin:2px 0px 0px;">${scrap}</div>
${gun_fit_properties}</div>
+
${gun_fit_properties}${improvement}</div>
 
</div>
 
</div>
 
|}]],
 
|}]],
_remodel_cost_template = [[<div style="text-align: center; background-color: lightgrey; margin:2px 0px 2px;">'''Remodel Cost'''</div>
+
_remodel_cost_template = [[<div class="infobox-kai-header-minor" style="text-align: center; margin:2px 0px 2px;">'''Remodel Cost'''</div>
<div style="text-align: center; background-color: whitesmoke; margin:2px 0px 2px;">${remodel_cost}</div>
+
<div style="text-align: center; margin:2px 0px 2px;">${remodel_cost}</div>
 
]],
 
]],
_reversion_cost_template = [[<div style="text-align: center; background-color: lightgrey; margin:2px 0px 2px;">'''Reversion to ${suffix}'''</div>
+
_reversion_cost_template = [[<div class="infobox-kai-header-minor" style="text-align: center; margin:2px 0px 2px;">'''Reversion to ${suffix}'''</div>
<div style="text-align: center; background-color: whitesmoke; margin:2px 0px 2px;">${level_items}<br />${resources}</div>
+
<div style="text-align: center; margin:2px 0px 2px;">${level_items}<br />${resources}</div>
 
]],
 
]],
_gun_fit_properties_template = format{[[<div style="text-align: center; background-color: lightgrey; margin:2px 0px 2px;"><b>${subtitle}</b></div>
+
_gun_fit_properties_template = format{[[<div class="infobox-kai-header-minor" style="text-align: center; margin:2px 0px 2px;"><b>${subtitle}</b></div>
${gun_fit_groups}]], subtitle = Formatting:tooltip("Large Caliber Fit Gun Properties", "Based on experimental findings")},
+
${gun_fit_groups}]], subtitle = "[[Overweight_Penalty_and_Fit_Gun_Bonus#Battleships|Large Caliber Fit Gun Properties]]"},
_gun_fit_group_template = [[
+
_gun_fit_group_template = [[<div style="text-align: left; display: flex; margin: 2px 0px;">
<div style="text-align: left; display: flex; margin: 2px 0px;">
   
<div style="margin-right: 1px; flex-shrink: 0; flex-basis: 140px; background-color: whitesmoke; display: flex; align-items: center;"><span>${fit_group}</span></div>
 
<div style="margin-right: 1px; flex-shrink: 0; flex-basis: 140px; background-color: whitesmoke; display: flex; align-items: center;"><span>${fit_group}</span></div>
 
<div style="margin-left: 1px; flex-grow: 1; background-color: whitesmoke; display: flex; align-items: center;"><b>${fit}</b></div>
 
<div style="margin-left: 1px; flex-grow: 1; background-color: whitesmoke; display: flex; align-items: center;"><b>${fit}</b></div>
 
</div>
 
</div>
]]
+
]],
 +
    _improvement_template = [[<div class="infobox-kai-header-minor" style="text-align: center; margin:2px 0px 2px;">'''Improvement'''</div>
 +
<div style="text-align: center; background-color: whitesmoke; margin:2px 0px 2px;">${category_tree}</div>
 +
]],
 +
    _improvement_category_template = "Equipment that can be improved with ${ship_name} as helper ship",
 
}
 
}
   Line 185: Line 192:  
local japanese_nick = self._ship:japanese_nick()
 
local japanese_nick = self._ship:japanese_nick()
 
local reading_nick = self._ship:reading_nick()
 
local reading_nick = self._ship:reading_nick()
if reading_nick then
+
if japanese_nick and reading_nick then
japanese_nick = tostring(Formatting:japanese_text{japanese_nick, reading_nick})
+
japanese_nick = tostring(Formatting:japanese_text(Formatting:format_stat(japanese_nick), Formatting:format_stat(reading_nick)))
 +
end
 +
if japanese_nick then
 +
self._vars.nick = format{self._nick_template, nick = nick, japanese_nick = japanese_nick}
 +
else
 +
self._vars.nick = format{self._simple_nick_template, nick = nick}
 
end
 
end
self._vars.nick = format{self._nick_template, nick = nick, japanese_nick = japanese_nick}
   
else
 
else
 
self._vars.nick = ""
 
self._vars.nick = ""
Line 218: Line 229:     
function ShipInfoKai:image()
 
function ShipInfoKai:image()
self._vars.image = ShipCardKai:get{ship = self._ship}
+
self._vars.image = ShipCardKai:get{ship = self._ship, hd = true}
 +
end
 +
 
 +
function ShipInfoKai:base_hp()
 +
    local hp = self._ship:hp()
 +
    local hp_mod = self._ship:hp_mod()
 +
self._vars.hp = hp_mod and hp_mod > 0 and Formatting:format_stat_with_max(hp, hp + hp_mod) or Formatting:format_stat(hp)
 
end
 
end
    
function ShipInfoKai:hp()
 
function ShipInfoKai:hp()
local hp = Formatting:format_stat(self._ship:hp())
+
self:base_hp()
--local hp_max = self._ship:hp_max()
+
local hp = self._ship:hp_married()
--if hp_max then
+
if hp then
-- self._vars.hp = Formatting:tooltip(hp, format{self._kekkon_max_template, value = Formatting:format_stat(hp_max)})
+
    local hp_mod = self._ship:hp_mod_married()
--else
+
self._vars.hp = Formatting:tooltip(self._vars.hp, format{
self._vars.hp = hp
+
    self._kekkon_template,
--end
+
    value = hp_mod and hp_mod > 0 and Formatting:format_stat_with_max(hp, hp + hp_mod) or Formatting:format_stat(hp),
 +
    max = Formatting:format_stat(self._ship:hp_max())
 +
        })
 +
end
 
end
 
end
   Line 260: Line 280:  
evasion_max = self._ship:evasion_max()
 
evasion_max = self._ship:evasion_max()
 
end
 
end
local result = Formatting:format_stat_with_max(evasion, evasion_max)
   
if not overridden and evasion and evasion_max then
 
if not overridden and evasion and evasion_max then
result = Formatting:tooltip(result, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:evasion_leveled(155))})
+
    local remodel_level = self._ship:remodel_level()
 +
    if self._ship:remodel_level() then
 +
        evasion = Formatting:tooltip(evasion, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:evasion_leveled(remodel_level))})
 +
    end
 +
evasion_max = Formatting:tooltip(evasion_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:evasion_leveled(180))})
 
end
 
end
 +
local result = Formatting:format_stat_with_max(evasion, evasion_max)
 
if overridden then
 
if overridden then
 
result = result .. self._overridden_category_template
 
result = result .. self._overridden_category_template
Line 295: Line 319:  
asw_max = self._ship:asw_max()
 
asw_max = self._ship:asw_max()
 
end
 
end
local result = Formatting:format_stat_with_max(asw, asw_max)
   
if not overridden and asw and asw_max then
 
if not overridden and asw and asw_max then
result = Formatting:tooltip(result, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:asw_leveled(155))})
+
    local remodel_level = self._ship:remodel_level()
 +
    if self._ship:remodel_level() then
 +
    asw = Formatting:tooltip(asw, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:asw_leveled(remodel_level))})
 +
        end
 +
asw_max = Formatting:tooltip(asw_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:asw_leveled(180))})
 
end
 
end
 +
local result = Formatting:format_stat_with_max(asw, asw_max)
 
if overridden then
 
if overridden then
 
result = result .. self._overridden_category_template
 
result = result .. self._overridden_category_template
Line 326: Line 354:  
los_max = self._ship:los_max()
 
los_max = self._ship:los_max()
 
end
 
end
local result = Formatting:format_stat_with_max(los, los_max)
   
if not overridden and los and los_max then
 
if not overridden and los and los_max then
result = Formatting:tooltip(result, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:los_leveled(155))})
+
    local remodel_level = self._ship:remodel_level()
 +
    if self._ship:remodel_level() then
 +
    los = Formatting:tooltip(los, format{self._remodel_level_stat_value_template, value = Formatting:format_stat(self._ship:los_leveled(remodel_level))})
 +
        end
 +
los_max = Formatting:tooltip(los_max, format{self._kekkon_max_template, value = Formatting:format_stat(self._ship:los_leveled(180))})
 
end
 
end
 +
local result = Formatting:format_stat_with_max(los, los_max)
 
if overridden then
 
if overridden then
 
result = result .. self._overridden_category_template
 
result = result .. self._overridden_category_template
Line 351: Line 383:  
local remodel_from = self._ship:remodel_from()
 
local remodel_from = self._ship:remodel_from()
 
if remodel_from then
 
if remodel_from then
self._vars.build_remodel_info = Formatting:format_remodel_level_and_item_cost(self._ship:remodel_level(), self._ship:remodel_blueprint(), self._ship:remodel_catapult())
+
self._vars.build_remodel_info = Formatting:format_remodel_level_and_item_cost(
 +
self._ship:remodel_level(),
 +
self._ship:remodel_blueprint(), self._ship:remodel_catapult(), self._ship:remodel_report(),
 +
self._ship:remodel_gunmat(), self._ship:remodel_airmat(), self._ship:remodel_armament()
 +
)
 
self._vars.remodel_cost = format{self._remodel_cost_template, remodel_cost = Formatting:format_resources(self._ship:remodel_cost())}
 
self._vars.remodel_cost = format{self._remodel_cost_template, remodel_cost = Formatting:format_resources(self._ship:remodel_cost())}
 
else
 
else
Line 372: Line 408:  
end
 
end
   −
if remodel_from ~= false and remodel_from == self._ship:remodel_to() then
+
    -- [[Category:Todo]]: _reversible is a hack
 +
if remodel_from ~= false and remodel_from == self._ship:remodel_to() or self._ship._reversible then
 
self._vars.reversion_cost = format{self._reversion_cost_template,  
 
self._vars.reversion_cost = format{self._reversion_cost_template,  
 
suffix = Formatting:format_stat(Ship(self._ship:remodel_to()):display_suffix()),  
 
suffix = Formatting:format_stat(Ship(self._ship:remodel_to()):display_suffix()),  
level_items = Formatting:format_remodel_level_and_item_cost(self._ship:remodel_to_level(), self._ship:remodel_to_blueprint(), self._ship:remodel_to_catapult()),
+
level_items = Formatting:format_remodel_level_and_item_cost(self._ship:remodel_to_level(), self._ship:remodel_to_blueprint(), self._ship:remodel_to_catapult(), self._ship:remodel_to_report(), self._ship:remodel_to_gunmat(), self._ship:remodel_to_airmat()),
 
resources = Formatting:format_resources(self._ship:remodel_to_cost())
 
resources = Formatting:format_resources(self._ship:remodel_to_cost())
 
}
 
}
Line 395: Line 432:  
end
 
end
 
for i = 1, slots_to_show do
 
for i = 1, slots_to_show do
local disabled, equipment, size, estimation, icon, color, equipment_type = num_of_enabled_slots and i > num_of_enabled_slots
+
local disabled, equipment, stars, size, estimation, icon, color, equipment_type = num_of_enabled_slots and i > num_of_enabled_slots
 
if num_of_slots and i > num_of_slots then
 
if num_of_slots and i > num_of_slots then
 
equipment, size, estimation, icon, color, equipment_type = "- Locked -", false, false, "", 0, false
 
equipment, size, estimation, icon, color, equipment_type = "- Locked -", false, false, "", 0, false
 
else
 
else
equipment, size, estimation = self._ship:slot(i)
+
equipment, size, estimation, eqStars = self._ship:slot(i)
 
if equipment then
 
if equipment then
 
icon = equipment:icon()
 
icon = equipment:icon()
 
color = equipment:back()
 
color = equipment:back()
 
equipment_type = equipment:type()
 
equipment_type = equipment:type()
equipment = Formatting:format_link(equipment:link())
+
equipment = EquipmentLink.format(nil, { equipment:name() })
 +
if eqStars then
 +
    stars = " " .. Formatting:format_slot_stars(eqStars)
 +
end
 
else
 
else
 
icon = disabled and "" or false
 
icon = disabled and "" or false
Line 417: Line 457:  
table.insert(slots, format{self._slot_template,  
 
table.insert(slots, format{self._slot_template,  
 
icon = icon,  
 
icon = icon,  
equipment = equipment,  
+
equipment = equipment,
 +
stars = stars or "",
 
slot_size = Formatting:format_slot_size(size, estimation),  
 
slot_size = Formatting:format_slot_size(size, estimation),  
 
color = "whitesmoke", --Formatting:format_equipment_back(color),  
 
color = "whitesmoke", --Formatting:format_equipment_back(color),  
Line 442: Line 483:  
if ship_type == 8 or ship_type == 9 or ship_type == 10 then
 
if ship_type == 8 or ship_type == 9 or ship_type == 10 then
 
local rows = {}
 
local rows = {}
for _, fit_group in ipairs(require('Module:LargeCaliberMainGunFit').fit_groups) do
+
for _, fit_group in ipairs(require('Module:GunFitGroups').large_caliber) do
 
table.insert(rows, format{self._gun_fit_group_template, fit_group = fit_group, fit = Formatting:format_fit_bonus(self._ship:gun_fit_properties(fit_group))})
 
table.insert(rows, format{self._gun_fit_group_template, fit_group = fit_group, fit = Formatting:format_fit_bonus(self._ship:gun_fit_properties(fit_group))})
 
end
 
end
Line 449: Line 490:  
self._vars.gun_fit_properties = ""
 
self._vars.gun_fit_properties = ""
 
end
 
end
 +
end
 +
 +
function ShipInfoKai:improvement()
 +
    self._vars.improvement = format{self._improvement_template, category_tree = tostring(require('Module:CategoryTree'){category = format{self._improvement_category_template, ship_name = self._ship:name()}, depth = 1})}
 
end
 
end
   Line 456: Line 501:  
else
 
else
 
self._ship = Ship(self._args[1])
 
self._ship = Ship(self._args[1])
 +
end
 +
if self._args.override and self._ship then
 +
    for key, value in pairs(self._args.override) do
 +
            self._ship[key] = value
 +
    end
 
end
 
end
 
end
 
end
Line 482: Line 532:  
local labels = {}
 
local labels = {}
 
for k,v in pairs(icons) do
 
for k,v in pairs(icons) do
icons[k] = Formatting:format_image{v}
+
icons[k] = Formatting:format_image{v, size = "18px"}
 
labels[k] = Formatting:format_stat_name(k)
 
labels[k] = Formatting:format_stat_name(k)
 
end
 
end
 
self._vars = {icons = icons, labels = labels}
 
self._vars = {icons = icons, labels = labels}
local table_classes = {"typography-xl-optout", "infobox"}
+
local table_classes = {"typography-xl-optout", "infobox", "infobox-kai", "infobox-ship"}
 
if self._args.classes then
 
if self._args.classes then
 
table.insert(table_classes, self._args.classes)
 
table.insert(table_classes, self._args.classes)
advmod, cssedit, janitor, Moderators, prechecked, Widget editors
6,955

edits