Jump to content

Module:Infobox building

From shapez Wiki
Revision as of 17:24, 25 October 2026 by Dengr1065 (talk | contribs) (Building infobox draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Documentation for this module may be created at Module:Infobox building/doc

local InfoboxBuilder = require("Module:InfoboxBuilder")

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	local pagetitle = mw.title.getCurrentTitle().fullText
	
	local infobox = InfoboxBuilder()
		:title(args.name or pagetitle)

	-- Hub does not have a baked sprite, a fake tutorial is used instead
	if args.sprite then
		local tabber = infobox:tabber()
		tabber:tab("Sprite"):image({image = args.sprite, caption = "Building sprite"})
		tabber:tab("Tutorial"):image({image = args.tutorial, caption = "Tutorial image"})
	else
		infobox:image({image = args.tutorial, caption = "Tutorial image"})
	end

	infobox:header("Building information")

	return tostring(infobox)
end

return p