Changes

Use Formatting module for rarity colors, show reading as tooltip for japanese name
Line 6: Line 6:     
local ShipInfoKai = {
 
local ShipInfoKai = {
_rarity_map = {
  −
[0] = "whitesmoke",
  −
[1] = "cornflowerblue",
  −
[2] = "lightskyblue",
  −
[3] = "mediumturquoise",
  −
[4] = "silver",
  −
[5] = "gold",
  −
[6] = "#eebbee",
  −
[7] = "#eebbee",
  −
[8] = "#eebbee",
  −
},
  −
_equipment_rarity_map = {
  −
[0] = "whitesmoke",
  −
[1] = "lightgrey",
  −
[2] = "lightsteelblue",
  −
[3] = "#eebbee",
  −
[4] = "#eebbee",
  −
[5] = "#eebbee",
  −
},
   
_catbomb = "Catbomb.png|300px",
 
_catbomb = "Catbomb.png|300px",
 
_unbuilable = "''Unbuildable''",
 
_unbuilable = "''Unbuildable''",
Line 98: Line 79:  
extra = format{" background-image: ${bloom}${sparkles}", bloom = rarity > 7 and Effects.bloom or "", sparkles = Effects.sparkles}
 
extra = format{" background-image: ${bloom}${sparkles}", bloom = rarity > 7 and Effects.bloom or "", sparkles = Effects.sparkles}
 
end
 
end
return self._rarity_map[rarity], extra
+
return Formatting:format_ship_back(rarity), extra
 
end
 
end
    
function ShipInfoKai:name(ship)
 
function ShipInfoKai:name(ship)
 
return Formatting:format_link(ship:link())
 
return Formatting:format_link(ship:link())
 +
end
 +
 +
function ShipInfoKai:japanese_name(ship)
 +
return Formatting:tooltip(Formatting:format_stat(ship:japanese_name()), Formatting:format_stat(ship:reading()))
 
end
 
end
   Line 204: Line 189:  
icon = Formatting:format_image(Formatting:format_equipment_icon(icon))
 
icon = Formatting:format_image(Formatting:format_equipment_icon(icon))
 
end
 
end
color = self._equipment_rarity_map[color]
+
color = Formatting:format_equipment_back(color)
 
table.insert(slots, format{self._slot_template, icon = icon, equipment = equipment, slot_size = size, color = color})
 
table.insert(slots, format{self._slot_template, icon = icon, equipment = equipment, slot_size = size, color = color})
 
end
 
end
Line 233: Line 218:  
vars.name = self:name(ship)
 
vars.name = self:name(ship)
 
vars.id = self:id(ship)
 
vars.id = self:id(ship)
vars.japanese_name = ship:japanese_name()
+
vars.japanese_name = self:japanese_name(ship)
 
vars.class = self:class(ship)
 
vars.class = self:class(ship)
 
vars.type = self:type(ship)
 
vars.type = self:type(ship)
Anonymous user