• 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
Fix column headers, row construction
Line 54: Line 54:  
"notes",
 
"notes",
 
},
 
},
_columns = {
+
_list_columns = {
 
"id",
 
"id",
 
"stars",
 
"stars",
Line 282: Line 282:     
if self._args.comparison == "true" then
 
if self._args.comparison == "true" then
 +
self._columns = self._comparison_columns
 
self._shown_stats = {}
 
self._shown_stats = {}
   Line 290: Line 291:  
else
 
else
 
row_values = {}
 
row_values = {}
for _, column in ipairs(self._comparison_columns) do
+
for _, column in ipairs(self._columns) do
 
row_values[column] = self[column](self, equipment)
 
row_values[column] = self[column](self, equipment)
 
end
 
end
 
if index > 1 then
 
if index > 1 then
for _, column in ipairs(self._comparison_columns) do
+
for _, column in ipairs(self._columns) do
 
for i=index-1,1,-1 do
 
for i=index-1,1,-1 do
 
local previous_row = data_rows[i]
 
local previous_row = data_rows[i]
Line 314: Line 315:  
end
 
end
 
else
 
else
for _, column in ipairs(self._comparison_columns) do
+
for _, column in ipairs(self._columns) do
 
row_values[column].rowspan = 1
 
row_values[column].rowspan = 1
 
end
 
end
Line 324: Line 325:  
local stat_columns = {}
 
local stat_columns = {}
 
for stat_column, _ in pairs(self._shown_stats) do
 
for stat_column, _ in pairs(self._shown_stats) do
table.insert(stat_columns, Formatting:format_image{StatIcons[stat_column], caption = Formatting:format_stat_name(stat_column)})
+
table.insert(stat_columns, format{self._column_header_cell_template, value = Formatting:format_image{StatIcons[stat_column], caption = Formatting:format_stat_name(stat_column)}})
 
end
 
end
for _, column in ipairs(self._comparison_columns) do
+
for _, column in ipairs(self._columns) do
 
if not self._shown_stats[column] then
 
if not self._shown_stats[column] then
 
for _, row_values in ipairs(data_rows) do
 
for _, row_values in ipairs(data_rows) do
Line 335: Line 336:  
header = format{self._header_template, stat_columns = table.concat(stat_columns, "\n")}
 
header = format{self._header_template, stat_columns = table.concat(stat_columns, "\n")}
 
else
 
else
 +
self._columns = self._list_columns
 
header = format{self._header_template, stat_columns = format{self._column_header_cell_template, value = self._stats_column_label}}
 
header = format{self._header_template, stat_columns = format{self._column_header_cell_template, value = self._stats_column_label}}
 
for _, equipment in ipairs(equipment_list) do
 
for _, equipment in ipairs(equipment_list) do
Anonymous user

Navigation menu