PC Gaming Shelter
An archive dedicated to preserving PC Gaming history and more

Module:Player: Difference between revisions

From PC Gaming Shelter
Created page with "local utils = require( 'Module:Utils' ) local p = {} local function propertiesPlan() -- ['Form field name'] = { 'Semantic property', 'delimiter' } local propMap = { ['Image'] = {'Image', 'file' }, ['Member of'] = {'Member of', ',' }, ['Has status'] = {'Has status' }, ['Plays game'] = {'Plays game', ',' }, ['Plays mod'] = {'Plays mod', ',' }, ['Has favorite mod'] = {'Has favorite mod', ',' }, ['Is me..."
 
No edit summary
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
['Is mentor for']      = {'Is mentor for', ',' },
['Is mentor for']      = {'Is mentor for', ',' },
['Is guardian for']    = {'Is guardian for', ',' },
['Is guardian for']    = {'Is guardian for', ',' },
['Has short description']            = {'Has short description' }
}
}
return propMap
return propMap
Line 33: Line 34:
order = '2',
order = '2',
rows = {
rows = {
'Member of',
'Has status',
'Has status',
'Plays game',
'Plays game',
'Plays mod',
'Plays mod',
'Has favorite mod'
'Has favorite mod'
}
},
['Clans'] = {
heading = 'Communities',
template = 'Infobox/Clans',
order = '3',
rows = {
'Communities'
}
}
},
},
Line 43: Line 51:
heading = 'Wiki',
heading = 'Wiki',
template = 'Infobox/Wiki',
template = 'Infobox/Wiki',
order = '3',
order = '4',
rows = {
rows = {
'Is guardian for',
'Is guardian for',
Line 55: Line 63:


function p.infobox(frame)
function p.infobox(frame)
local category  = 'Games'
local category  = 'Players'
local properties = propertiesPlan()
local properties = propertiesPlan()
local sections  = infoboxSectionPlan()
local sections  = infoboxSectionPlan()
local footer    = 'Game footer'
local footer    = ''
local infobox    = utils.createInfobox(frame, category, properties, sections, footer)
local infobox    = utils.createInfobox(frame, category, properties, sections, footer)
return infobox
return infobox

Latest revision as of 17:31, 25 March 2026

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

local utils = require( 'Module:Utils' )

local p = {}

local function propertiesPlan()
	-- ['Form field name'] = { 'Semantic property', 'delimiter' }
	local propMap = {
		['Image']               = {'Image', 'file' },
		['Member of']           = {'Member of', ',' },
		['Has status']          = {'Has status' },
		['Plays game']          = {'Plays game', ',' },
		['Plays mod']           = {'Plays mod', ',' },
		['Has favorite mod']    = {'Has favorite mod', ',' },
		['Is mentor for']       = {'Is mentor for', ',' },
		['Is guardian for']     = {'Is guardian for', ',' },
		['Has short description']            = {'Has short description' }
	}
	return propMap
end

local function infoboxSectionPlan()
	local sectionMap = {
		['Cover image'] = {
			heading = '',
			template = 'Infobox/Cover',
			order = '1',
			rows = {
				'Image'
			}
		},
		['Player Info'] = {
			heading = 'Player Info',
			template = 'Infobox/Player Info',
			order = '2',
			rows = {
				'Has status',
				'Plays game',
				'Plays mod',
				'Has favorite mod'
			}
		},
		['Clans'] = {
			heading = 'Communities',
			template = 'Infobox/Clans',
			order = '3',
			rows = {
				'Communities'
			}
		},
		['Wiki'] = {
			heading = 'Wiki',
			template = 'Infobox/Wiki',
			order = '4',
			rows = {
				'Is guardian for',
				'Is mentor for',
				'Contact links'
			}
		}
	}
	return sectionMap
end

function p.infobox(frame)
	local category   = 'Players'
	local properties = propertiesPlan()
	local sections   = infoboxSectionPlan()
	local footer     = ''
	local infobox    = utils.createInfobox(frame, category, properties, sections, footer)
	return infobox
end

return p