- 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:EliteShipsKaiSortable"
Jump to navigation
Jump to search
com>Ckwng m (typo) |
com>Ckwng |
||
Line 3: | Line 3: | ||
local EliteShipsKaiSortable = EliteShipsKai{ | local EliteShipsKaiSortable = EliteShipsKai{ | ||
_table_start = [[{| class="wikitable sortable typography-xl-optout"]], | _table_start = [[{| class="wikitable sortable typography-xl-optout"]], | ||
+ | _base_columns = { --gets copied to self._columns in create_table_prep so we can mutate it. Don't mutate base_columns! | ||
+ | "id", | ||
+ | "name", | ||
+ | "class", | ||
+ | "remodel", | ||
+ | "firepower", | ||
+ | "torpedo", --night_battle is added after this depending on args in create_table_prep. If adding columns please preserve this behaviour. | ||
+ | "aa", | ||
+ | "asw", | ||
+ | "los", | ||
+ | "luck", | ||
+ | "luck_max", | ||
+ | "hp", | ||
+ | "armor", | ||
+ | "evasion", | ||
+ | "speed", | ||
+ | "aircraft", | ||
+ | "fuel", | ||
+ | "ammo", | ||
+ | "notes", | ||
+ | }, | ||
} | } | ||
+ | |||
+ | function EliteShipsKaiSortable:luck(ship) | ||
+ | local luck = ship:luck() | ||
+ | return {values = {value = Formatting:format_stat(luck)}, bg_color = self:get_bg_color(self._cell_color.luck, luck, self._args.luck_operator, self._args.luck_outstanding, self._args.luck_good, self._args.luck_bad), text_align = self._center_align} | ||
+ | end | ||
+ | |||
+ | function EliteShipsKaiSortable:luck_max(ship) | ||
+ | local luck_max = ship:luck_max() | ||
+ | return {values = {value = self:get_emphasis(luck_max, Formatting:format_stat(luck_max), self._args.luck_max_operator, self._args.luck_max_good)}, bg_color = self._transparent, text_align = self._center_align} | ||
+ | end | ||
EliteShipsKaiSortable.create_data_rows = EliteShipsKaiSortable.create_data_rows_plain | EliteShipsKaiSortable.create_data_rows = EliteShipsKaiSortable.create_data_rows_plain | ||
return EliteShipsKaiSortable | return EliteShipsKaiSortable |
Revision as of 05:32, 8 July 2016
Documentation for this module may be created at Module:EliteShipsKaiSortable/doc
local EliteShipsKai = require('Module:EliteShipsKai')
local EliteShipsKaiSortable = EliteShipsKai{
_table_start = [[{| class="wikitable sortable typography-xl-optout"]],
_base_columns = { --gets copied to self._columns in create_table_prep so we can mutate it. Don't mutate base_columns!
"id",
"name",
"class",
"remodel",
"firepower",
"torpedo", --night_battle is added after this depending on args in create_table_prep. If adding columns please preserve this behaviour.
"aa",
"asw",
"los",
"luck",
"luck_max",
"hp",
"armor",
"evasion",
"speed",
"aircraft",
"fuel",
"ammo",
"notes",
},
}
function EliteShipsKaiSortable:luck(ship)
local luck = ship:luck()
return {values = {value = Formatting:format_stat(luck)}, bg_color = self:get_bg_color(self._cell_color.luck, luck, self._args.luck_operator, self._args.luck_outstanding, self._args.luck_good, self._args.luck_bad), text_align = self._center_align}
end
function EliteShipsKaiSortable:luck_max(ship)
local luck_max = ship:luck_max()
return {values = {value = self:get_emphasis(luck_max, Formatting:format_stat(luck_max), self._args.luck_max_operator, self._args.luck_max_good)}, bg_color = self._transparent, text_align = self._center_align}
end
EliteShipsKaiSortable.create_data_rows = EliteShipsKaiSortable.create_data_rows_plain
return EliteShipsKaiSortable