Module:GameInfo

From Little Tail Wiki
Revision as of 08:46, 23 November 2024 by Meguumin (talk | contribs) (Protected "Module:GameInfo" ([Edit=Allow only administrators] (indefinite)))
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Module:GameInfo

Tail Concerto logo (IMAGE REQUIRED)
Info.
Release date(s) X
Publisher X
Developer X
System(s) X
Genre X
Number of players X
Rating X

The GameInfo infobox serves as a quick rundown of the article's featured videogame.

Infoboxes are put together via Capiunto, which calls upon a Lua-based module. This keeps infoboxes clean and easy to form as long as all required rows are present. Failure to fill all rows will throw an error over the page.

Usage

{{GameInfo
| headerstyle = (defaults to background-color:grey)
| image       = [[File:TailConcerto Logo.png|200px]]
| caption     =  Tail Concerto logo (IMAGE REQUIRED)
| ("Info.")
| releasedate = X
| publisher   = X
| developer   = X
| systems     = X
| genre       = X
| numofplayers = X
| rating      = X
}}

local capiunto = require 'capiunto'

local p = {}

function p.main(frame)
	local args = frame:getParent().args
	local headerStyle
	if args.headerstyle and args.headerstyle ~= '' then
		headerStyle = string.format('background-color:%s;', args.headerstyle)
	else
		headerStyle = 'background-color:grey;'
	end
	local retval = capiunto.create( {
		title = tostring(mw.title.getCurrentTitle()) ,
		headerStyle = headerStyle, 
	} )
	:addImage( args.image, args.caption )
	:addHeader( 'Info.' )
	:addRow( 'Release date(s)', args.releasedate )
	:addRow( 'Publisher', args.publisher )
	:addRow( 'Developer', args.developer )
    :addRow( 'System(s)', args.systems )
    :addRow( 'Genre', args.genre )
    :addRow( 'Number of players', args.numofplayers )
    :addRow( 'Rating', args.rating )

    
     return retval
    end

return p