Changes

no edit summary
Line 33: Line 33:  
| colspan="6" style="text-align: center; background-color: LightSkyBlue;"|'''Statistics'''
 
| colspan="6" style="text-align: center; background-color: LightSkyBlue;"|'''Statistics'''
 
|-
 
|-
| colspan="2" style="width: 88px;" | ${hp_icon} HP
+
| colspan="2" style="width: 88px;" | ${icons.hp} ${labels.hp}
 
| style="width: 66px;" | '''${hp}'''
 
| style="width: 66px;" | '''${hp}'''
| style="width: 88px;" | ${firepower_icon} Firepower
+
| style="width: 88px;" | ${icons.firepower} ${labels.firepower}
 
| colspan="2" style="width: 60px;" | '''${firepower}'''
 
| colspan="2" style="width: 60px;" | '''${firepower}'''
 
|-
 
|-
| colspan="2" style="width: 88px;" | ${armor_icon} Armor
+
| colspan="2" style="width: 88px;" | ${icons.armor} ${labels.armor}
 
| style="width: 66px;" | '''${armor}'''
 
| style="width: 66px;" | '''${armor}'''
| style="width: 88px;" | ${torpedo_icon} Torpedo
+
| style="width: 88px;" | ${icons.torpedo} ${labels.torpedo}
 
| colspan="2" style="width: 66px;" | '''${torpedo}'''
 
| colspan="2" style="width: 66px;" | '''${torpedo}'''
 
|-
 
|-
| colspan="2" style="width: 88px;" | ${evasion_icon} Evasion
+
| colspan="2" style="width: 88px;" | ${icons.evasion} ${labels.evasion}
 
| style="width: 66px;" | '''${evasion}'''
 
| style="width: 66px;" | '''${evasion}'''
| style="width: 88px;" | ${aa_icon} AA
+
| style="width: 88px;" | ${icons.aa} ${labels.aa}
 
| colspan="2" style="width: 66px;" | '''${aa}'''
 
| colspan="2" style="width: 66px;" | '''${aa}'''
 
|-
 
|-
| colspan="2" style="width: 88px;" | ${aircraft_icon} Aircraft
+
| colspan="2" style="width: 88px;" | ${icons.aircraft} ${labels.aircraft}
 
| style="width: 66px;" | '''${aircraft}'''
 
| style="width: 66px;" | '''${aircraft}'''
| style="width: 88px;" | ${asw_icon} ASW
+
| style="width: 88px;" | ${icons.asw} ${labels.asw}
 
| colspan="2" style="width: 66px;" | '''${asw}'''
 
| colspan="2" style="width: 66px;" | '''${asw}'''
 
|-
 
|-
| colspan="2" style="width: 88px;" | ${speed_icon} Speed
+
| colspan="2" style="width: 88px;" | ${icons.speed} ${labels.speed}
 
| style="width: 66px;" | '''${speed}'''
 
| style="width: 66px;" | '''${speed}'''
| style="width: 88px;" | ${los_icon} LOS
+
| style="width: 88px;" | ${icons.los} ${labels.los}
 
| colspan="2" style="width: 66px;" | '''${los}'''
 
| colspan="2" style="width: 66px;" | '''${los}'''
 
|-
 
|-
| colspan="2" style="width: 88px;" | ${range_icon} Range
+
| colspan="2" style="width: 88px;" | ${icons.range} ${labels.range}
 
| style="width: 66px;" | '''${range}'''
 
| style="width: 66px;" | '''${range}'''
| style="width: 88px;" | ${luck_icon} Luck
+
| style="width: 88px;" | ${icons.luck} ${labels.luck}
 
| colspan="2" style="width: 66px;" | '''${luck}'''
 
| colspan="2" style="width: 66px;" | '''${luck}'''
 
|-
 
|-
Line 224: Line 224:  
function ShipInfoKai:Infobox(name, model)
 
function ShipInfoKai:Infobox(name, model)
 
local ship = Ship(name, model)
 
local ship = Ship(name, model)
local vars = {
+
local vars = {}
hp_icon = StatIcons.hp,
+
local icons = {
firepower_icon = StatIcons.firepower,
+
hp = StatIcons.hp,
armor_icon = StatIcons.armor,
+
firepower = StatIcons.firepower,
torpedo_icon = StatIcons.torpedo,
+
armor = StatIcons.armor,
evasion_icon = StatIcons.evasion,
+
torpedo = StatIcons.torpedo,
aa_icon = StatIcons.aa,
+
evasion = StatIcons.evasion,
aircraft_icon = StatIcons.aircraft,
+
aa = StatIcons.aa,
asw_icon = StatIcons.asw,
+
aircraft = StatIcons.aircraft,
speed_icon = StatIcons.speed,
+
asw = StatIcons.asw,
los_icon = StatIcons.los,
+
speed = StatIcons.speed,
range_icon = StatIcons.range,
+
los = StatIcons.los,
luck_icon = StatIcons.luck,
+
range = StatIcons.range,
 +
luck = StatIcons.luck,
 
}
 
}
for k,v in pairs(vars) do
+
local labels = {}
vars[k] = mw.ustring.format(self._image_template, v)
+
for k,v in pairs(icons) do
 +
icons[k] = Formatting:format_image{v}
 +
labels[k] = Formatting:format_stat_name(k)
 
end
 
end
 
local rarity = ship:rarity(true) or 0
 
local rarity = ship:rarity(true) or 0
 +
vars.icons = icons
 +
vars.labels = labels
 
vars.top_bg_color, vars.top_extra_style = self:bg_color(ship)
 
vars.top_bg_color, vars.top_extra_style = self:bg_color(ship)
 
vars.name = self:name(ship)
 
vars.name = self:name(ship)
Anonymous user