• Welcome to the Kancolle Wiki!
  • If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord

Changes

Jump to navigation Jump to search
Add nickname and _is_type = true ship class support
Line 20: Line 20:  
_edit_link_text = "Edit",
 
_edit_link_text = "Edit",
 
_kekkon_max_template = "Maximum after marriage: ${value}",
 
_kekkon_max_template = "Maximum after marriage: ${value}",
 +
_nick_template = " (${nick} ${japanese_nick})",
 
_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}
Line 30: Line 31:  
|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" 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 style="font-size:20px">'''${name}'''</p>
 
<p style="font-size:20px">'''${name}'''</p>
<p style="font-size:15px">'''No.${id} ${japanese_name}'''</p>
+
<p style="font-size:15px">'''No.${id} ${japanese_name}${nick}'''</p>
 
<p>'''${class} ${type}'''</p>
 
<p>'''${class} ${type}'''</p>
 
|- style="background-color: whitesmoke;"
 
|- style="background-color: whitesmoke;"
Line 113: Line 114:  
function ShipInfoKai:japanese_name(ship)
 
function ShipInfoKai:japanese_name(ship)
 
return Formatting:tooltip(Formatting:format_stat(ship:japanese_name()), Formatting:format_stat(ship:reading()))
 
return Formatting:tooltip(Formatting:format_stat(ship:japanese_name()), Formatting:format_stat(ship:reading()))
 +
end
 +
 +
function ShipInfoKai:nick(ship)
 +
local nick = ship:nick()
 +
if nick then
 +
local japanese_nick = ship:japanese_nick()
 +
local reading_nick = ship:reading_nick()
 +
if reading_nick then
 +
japanese_nick = Formatting:tooltip(japanese_nick, reading_nick)
 +
end
 +
return format{self._nick_template, nick = nick, japanese_nick = japanese_nick}
 +
end
 +
return ""
 
end
 
end
   Line 125: Line 139:     
function ShipInfoKai:type(ship)
 
function ShipInfoKai:type(ship)
return Formatting:format_ship_type(ship:type())
+
local class = ship:class()
 +
local ship_type = ship:type()
 +
if class and class:is_type() then
 +
ship_type = "(" .. ship_type .. ")"
 +
end
 +
return Formatting:format_ship_type(ship_type)
 
end
 
end
   Line 297: Line 316:  
vars.id = self:id(ship)
 
vars.id = self:id(ship)
 
vars.japanese_name = self:japanese_name(ship)
 
vars.japanese_name = self:japanese_name(ship)
 +
vars.nick = self:nick(ship)
 
vars.class = self:class(ship)
 
vars.class = self:class(ship)
 
vars.type = self:type(ship)
 
vars.type = self:type(ship)
Anonymous user

Navigation menu