• 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
no edit summary
Line 232: Line 232:  
     end
 
     end
 
     return Utils.concat(forms, seasonal_forms)
 
     return Utils.concat(forms, seasonal_forms)
 +
end
 +
 +
function ShipPage.Gallery(frame, args)
 +
    args = args or Utils.getTemplateArgs(frame)
 +
    local ship_name = args.explicit.ship or args.implicit.pagename or ""
 +
    local forms = ship_cgs(ship_name)
 +
    local result = {}
 +
    for _, form in ipairs(forms) do
 +
        if form.normal or form.damaged then
 +
            local name, suffix = Ship:process_ship_key(form.name)
 +
            suffix = suffix or ""
 +
            local title = form.seasonal and suffix or suffix == "" and name or suffix
 +
            table.insert(result, "<h2>" .. title .. "</h2>")
 +
            if form.normal and form.damaged then
 +
                local image = ShipGraphicKai:Asset({ form.name, link = "nil" })
 +
                local image_damaged = ShipGraphicKai:Asset({ form.name, link = "nil", damaged = true })
 +
                table.insert(result, image)
 +
                table.insert(result, image_damaged)
 +
            else
 +
                local image = ShipGraphicKai:Asset({ form.name, link = "nil", damaged = form.damaged and true })
 +
                table.insert(result, image)
 +
            end
 +
        end
 +
    end
 +
    return table.concat(result, "\n")
 
end
 
end
  
cssedit, gkautomate
7,064

edits

Navigation menu