• 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 notes
Line 87: Line 87:  
_center_align = "center",
 
_center_align = "center",
 
_notes_suffix = "_notes",
 
_notes_suffix = "_notes",
 +
_highlight_suffix = "_highlight",
 
_stats_column_label = "Stats",
 
_stats_column_label = "Stats",
 
_table_end = [[|}]],
 
_table_end = [[|}]],
Line 275: Line 276:     
function EquipmentListKai:notes(equipment)
 
function EquipmentListKai:notes(equipment)
return {values = {value = ""}, bg_color = self._transparent, text_align = self._start_align}
+
local note = self._notes[equipment]
 +
if note then
 +
local bg_color
 +
if note.highlight == "outstanding" then
 +
bg_color = self._outstanding_stat_color
 +
elseif note.highlight == "good" then
 +
bg_color = self._good_stat_color
 +
else
 +
bg_color = self._transparent
 +
end
 +
return {values = {value = note.note or ""}, bg_color = bg_color}
 +
end
 +
return {values = {value = ""}, bg_color = self._transparent}
 
end
 
end
   Line 314: Line 327:  
table.insert(equipment_list, "header")
 
table.insert(equipment_list, "header")
 
else
 
else
table.insert(equipment_list, Equipment(equipment_name))
+
local equipment = Equipment(equipment_name)
 +
table.insert(equipment_list, equipment)
 
local note = self._args[equipment_name .. self._notes_suffix]
 
local note = self._args[equipment_name .. self._notes_suffix]
 
if note then
 
if note then
self._notes[equipment_name] = note
+
note = {note = note}
 +
local note_highlight = args[equipment_name .. self._notes_suffix .. self._highlight_suffix]
 +
if note_highlight then
 +
note.highlight = note_highlight
 +
end
 +
self._notes[equipment] = note
 
end
 
end
 
end
 
end
Anonymous user

Navigation menu