Module:ShipPage

local Utils = require("Module:Utils") local format = require("Module:StringOperations").format local Formatting = require("Module:Formatting") local BaseData = require("Module:BaseData") local Ship = require("Module:Ship") local ShipGraphicKai = require('Module:ShipGraphicKai')

-- : support passing Ship object in those modules, use Ship object, redo and move ship_remodel_forms function local ShipMetaKai = require("Module:ShipMetaKai") local ShipInfoKai = require("Module:ShipInfoKai") local ShipCategoriesKai = require("Module:ShipCategoriesKai")

-- can't use Ship:remodel_to_level normally for some reason local reversible_forms = {}

function ship_remodel_forms(ship_name, seasonal_forms, ship_suffix, j)   j = j or 1 ship_suffix = ship_suffix or "" local forms = { ship_name .. "/" .. ship_suffix } local success, ship_data = Utils.requireModule(ship_name) if not success then return forms end local form_data = ship_data[ship_suffix] if seasonal_forms then for suffix, data in pairs(ship_data) do           if data._seasonal == true and data._name and data._suffix then table.insert(seasonal_forms, data._name .. "/" .. data._suffix) end end end local i = 0 while form_data and form_data._remodel_to and not Utils.find(forms, form_data._remodel_to) and i < 10 and j <= 3 do       local ship_name_next, ship_suffix_next = Ship:process_ship_key(form_data._remodel_to) if ship_name_next ~= ship_name then return Utils.concat(forms, ship_remodel_forms(ship_name_next, seasonal_forms, ship_suffix_next, j + 1)) else table.insert(forms, form_data._remodel_to) form_data = ship_data[ship_suffix_next] if form_data._remodel_to_level then reversible_forms[form_data._name .. "/" .. (form_data._suffix or "")] = true end end i = i + 1 end return forms end

local ShipPage = {

_header = "${notice}${ship_meta}${clear}${ship_infoboxes}${ship_categories}",

_ship_infobox = [[

${title}
${infobox} ]],

_ship_infobox_titles = { "Basic", "Upgrade", "Second Upgrade", "Third Upgrade", "Fourth Upgrade", "Fifth Upgrade" },

_footer_links = [=[*View ${ship_name} CG ${ship_type}${wikipedia}${extra_links}]=],

_wikipedia = [=[*Wikipedia entry on ${ship_type} ${ship_name}]=], _ship_type = [=[*List of ${ship_type}s]=],

_sandbox_notice = [=[This is a testing ship page, it does not correspond to an actual ship. ]=],

_gallery_tabber = [[

]],

_gallery_normal = [[

]],

_gallery_damaged = [[

]],

_footer_sections = [=[

CG
${gallery}