- Welcome to the Kancolle Wiki!
- If you have any questions regarding site content, account registration, etc., please visit the KanColle Wiki Discord
Difference between revisions of "Module:EquipmentListKai"
Jump to navigation
Jump to search
com>Ckwng |
com>Ckwng |
||
Line 7: | Line 7: | ||
local EquipmentListKai = BaseTable{ | local EquipmentListKai = BaseTable{ | ||
− | + | _item_class = Equipment, | |
− | |||
_header_template = [[! No. | _header_template = [[! No. | ||
! Rarity | ! Rarity | ||
Line 20: | Line 19: | ||
name = [[| colspan="1" rowspan="${rowspan}" style="text-align: ${text_align}; background-color: ${bg_color}; padding:5px 5px 5px 5px;" |${values.name}<br />${values.icon} ${values.japanese_name}]] | name = [[| colspan="1" rowspan="${rowspan}" style="text-align: ${text_align}; background-color: ${bg_color}; padding:5px 5px 5px 5px;" |${values.name}<br />${values.icon} ${values.japanese_name}]] | ||
}, | }, | ||
− | + | _columns = { | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
"id", | "id", | ||
"stars", | "stars", | ||
Line 111: | Line 75: | ||
text_align = self._start_align, | text_align = self._start_align, | ||
} | } | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
Line 244: | Line 88: | ||
local note = self._notes[equipment] | local note = self._notes[equipment] | ||
if note then | if note then | ||
− | + | return {values = {value = note.note or ""}, bg_color = self._transparent} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | return {values = {value = note.note or ""}, bg_color = | ||
end | end | ||
return {values = {value = ""}, bg_color = self._transparent} | return {values = {value = ""}, bg_color = self._transparent} | ||
end | end | ||
− | function EquipmentListKai: | + | function EquipmentListKai:create_header() |
− | + | self._header = format{self._header_template, stat_columns = format{self._column_header_cell_template, value = self._stats_column_label}} | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
end | end | ||
return EquipmentListKai | return EquipmentListKai |
Revision as of 10:42, 25 March 2015
Documentation for this module may be created at Module:EquipmentListKai/doc
local BaseTable = require('Module:BaseTable')
local Equipment = require('Module:Equipment')
local Formatting = require('Module:Formatting')
local StatIcons = require('Module:StatIcons')
local format = require('Module:StringInterpolation').format
local EquipmentListKai = BaseTable{
_item_class = Equipment,
_header_template = [[! No.
! Rarity
! Name
! style="width: 120px" | Type
${stat_columns}
! style="width: 120px" | Classes
! Craftable
! style="white-space:nowrap;width:130px;" | Notes]],
_column_cell_templates = {
name = [[| colspan="1" rowspan="${rowspan}" style="text-align: ${text_align}; background-color: ${bg_color}; padding:5px 5px 5px 5px;" |${values.name}<br />${values.icon} ${values.japanese_name}]]
},
_columns = {
"id",
"stars",
"name",
"equipment_type",
"stats",
"compatibility",
"buildable",
"notes",
},
_stats_column_label = "Stats",
}
function EquipmentListKai:id(equipment)
return {values = {value = Formatting:format_stat(equipment:id())}, bg_color = self._transparent, text_align = self._center_align}
end
function EquipmentListKai:stars(equipment)
return {values = {value = Formatting:format_stars(equipment:stars())}, bg_color = self._transparent, text_align = self._center_align}
end
function EquipmentListKai:name(equipment)
return {values = {name = Formatting:format_link(equipment:link()),
icon = Formatting:format_image{Formatting:format_equipment_icon(equipment:icon())},
japanese_name = Formatting:format_stat(equipment:japanese_name())
},
bg_color = self._transparent,
text_align = self._start_align,
}
end
function EquipmentListKai:equipment_type(equipment)
return {values = {value = Formatting:format_equipment_type(equipment:type())}, bg_color = self._transparent, text_align = self._center_align}
end
function EquipmentListKai:stats(equipment)
return {values = {value = Formatting:format_stat_bonuses({
firepower = equipment:firepower(),
bombing = equipment:bombing(),
torpedo = equipment:torpedo(),
aa = equipment:aa(),
armor = equipment:armor(),
asw = equipment:asw(),
shelling_accuracy = equipment:shelling_accuracy(),
torpedo_accuracy = equipment:torpedo_accuracy(),
evasion = equipment:evasion(),
los = equipment:los(),
speed = Formatting:format_speed(equipment:speed()),
luck = equipment:luck(),
range = Formatting:format_range(equipment:range()),
special = false,
}, "<br />"),
},
bg_color = self._transparent,
text_align = self._start_align,
}
end
function EquipmentListKai:compatibility(equipment)
return {values = {value = Formatting:format_ship_compatibility(equipment:equippable())}, bg_color = self._transparent, text_align = self._start_align}
end
function EquipmentListKai:buildable(equipment)
return {values = {value = Formatting:format_boolean(equipment:buildable())}, bg_color = self._transparent, text_align = self._center_align}
end
function EquipmentListKai:notes(equipment)
local note = self._notes[equipment]
if note then
return {values = {value = note.note or ""}, bg_color = self._transparent}
end
return {values = {value = ""}, bg_color = self._transparent}
end
function EquipmentListKai:create_header()
self._header = format{self._header_template, stat_columns = format{self._column_header_cell_template, value = self._stats_column_label}}
end
return EquipmentListKai