- 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
Line 87:
Line 87:
− +
Line 142:
Line 142:
− +
− bg_color = self._available_color +
− table.insert(availability, mw.ustring.sub(ship:name(), 1, 2))+
+
+
+
+
+
+
+
+
+
+
− +
no edit summary
local consumed_equipment = {}
local consumed_equipment = {}
for equip, count in pairs(consumed_equipment_table) do
for equip, count in pairs(consumed_equipment_table) do
local equipment = equip and Equipment(equip) or row_data.item
local equipment = equip ~= true and Equipment(equip) or row_data.item
table.insert(consumed_equipment, format{self._equipment_item, count = count, icon = Formatting:format_equipment_icon_simple(equipment:icon()), name = Formatting:format_link(equipment:link())})
table.insert(consumed_equipment, format{self._equipment_item, count = count, icon = Formatting:format_equipment_icon_simple(equipment:icon()), name = Formatting:format_link(equipment:link())})
end
end
function ImprovementTableKai:availability(row_data, day)
function ImprovementTableKai:availability(row_data, day)
local availability = {}
local availability = {}
local bg_color = self._unavailable_color
local available = false
for index, ship in ipairs(row_data.ships) do
for index, ship in ipairs(row_data.ships) do
if row_data.availability[ship][day] then
if row_data.availability[ship][day] then
available = true
local ship_initial
if ship ~= true then
if not self._helper_ships then
self._helper_ships = {}
end
self._helper_ships[ship] = Ship(ship)
ship_initial = mw.ustring.sub(self._helper_ships[ship]:name(), 1, 2)
else
ship_initial = "✓"
end
table.insert(availability, ship_initial)
else
else
table.insert(availability, " ")
table.insert(availability, " ")
end
end
end
end
return {values = {value = table.concat(availability, "<br />")}, bg_color = bg_color, text_align = self._center_align}
return {values = {value = available and table.concat(availability, "<br />") or "✗"}, bg_color = available and self._available_color or self._unavailable_color, text_align = self._center_align}
end
end