Module:Multiblock
Appearance
Documentation for this module may be created at Module:Multiblock/doc
local p = {}
local function getArg(args, name)
return args[name] or ""
end
function p.main(frame)
local parent = frame:getParent()
local source = parent.args
local args = {}
-- Basic infobox settings
args.above = getArg(source, "name")
args.subheader = getArg(source, "subheader")
args.autoheaders = "y"
args.abovestyle = "background:#eaecee;font-size:130%;padding:0.3em;"
args.headerstyle = "background:#eaecee;"
-- Images
for i = 1, 2 do
local image = getArg(source, "image" .. (i == 1 and "" or i))
if image ~= "" then
args["image" .. (i == 1 and "" or i)] =
"[[File:" .. image ..
"|frameless|alt=" .. getArg(source, "alt") ..
"|border|upright=1|]]"
end
end
if getArg(source, "image3") ~= "" then
args.image3 = getArg(source, "image3")
end
args.caption = getArg(source, "caption")
args.caption2 = getArg(source, "caption2")
-- Properties
args.header10 = "Properties"
args.label11 = "Maximum Power Storage"
args.data11 = getArg(source, "powerstorage")
for i = 1, 15 do
args["label" .. (11 + i)] =
getArg(source, "custom_property_title" .. i)
args["data" .. (11 + i)] =
getArg(source, "custom_property_value" .. i)
end
-- Load the inventory slot module near the top of Module:Multiblock
local slotModule = require("Module:Inventory slot")
-- Resource requirements
args.header27 = "Resource Requirements"
args["data" .. (27 + i)] =
material .. " × " .. amount
-- Render the standard infobox
return frame:expandTemplate{
title = "Infobox",
args = args
}
end
return p