Changes
Allow equipment argument that has no improvements
for _, item in ipairs(self._items) do
for _, item in ipairs(self._items) do
local products = item:improvement_products()
local products = item:improvement_products()
if self._single_item then
self._title_row = format{[[|+ ${icon}${name}]], icon = Formatting:format_image{Formatting:format_equipment_icon(item:icon())}, name = Formatting:format_link(item:link())}
else
self._custom_rows[item:name()] = format{[[! colspan="12" style="text-align: center; padding:5px 5px 5px 5px;" | ${icon}${name}: ${resources}]], icon = Formatting:format_image{Formatting:format_equipment_icon(item:icon())}, name = Formatting:format_link(item:link()), resources = Formatting:format_resources(item:improvement_resources() or {devmat = false, screw = false})}
table.insert(result, item:name())
end
if products then
if products then
for _, product in ipairs(products) do
for _, product in ipairs(products) do
local ships = item:improvement_ships(product)
local ships = item:improvement_ships(product)
table.insert(result, {item = item, product = product, stars = stars, ships = ships, ship_data = ship_data, availability = availability, resources = item:improvement_resources(false, product, stars), resources_x = item:improvement_resources(true, product, stars)})
table.insert(result, {item = item, product = product, stars = stars, ships = ships, ship_data = ship_data, availability = availability, resources = item:improvement_resources(false, product, stars), resources_x = item:improvement_resources(true, product, stars)})
end
end
end
else
for _, stars in ipairs(self._improvement_brackets) do
table.insert(result, {item = item, stars = stars})
end
end
end
end
local availability = {}
local availability = {}
local available = false
local available = false
for index, ship in ipairs(row_data.ships) do
if row_data.ships then
for index, ship in ipairs(row_data.ships) do
if row_data.availability[ship][day] then
available = true
local ship_initial
if ship ~= true then
ship_initial = mw.ustring.sub(row_data.ship_data[ship]:name(), 1, 1)
else
ship_initial = "✓"
end
table.insert(availability, ship_initial)
else
else
table.insert(availability, " ")
end
end
end
end
end
end
function ImprovementTableKai:helper_ships(row_data)
function ImprovementTableKai:helper_ships(row_data)
local ships = {}
local ships = {}
for index, ship in ipairs(row_data.ships) do
if row_data.ships then
for index, ship in ipairs(row_data.ships) do
if ship ~= true then
table.insert(ships, Formatting:format_link(row_data.ship_data[ship]:link()))
else
table.insert(ships, "Any")
end
end
end
end
end