Module:Game: Difference between revisions
From PC Gaming Shelter
No edit summary |
No edit summary |
||
| (9 intermediate revisions by the same user not shown) | |||
| Line 19: | Line 19: | ||
} | } | ||
return propMap | return propMap | ||
end | end | ||
local function infoboxSectionPlan() | local function infoboxSectionPlan() | ||
local sectionMap = { | local sectionMap = { | ||
['Cover image'] = { | |||
heading = '', | |||
template = 'Infobox/Cover', | |||
order = '1', | |||
rows = { | |||
'Image' | |||
} | |||
}, | |||
['Game Info'] = { | ['Game Info'] = { | ||
'Developer', | heading = 'Game Info', | ||
template = 'Infobox/Game Info', | |||
order = '2', | |||
rows = { | |||
'Developer', | |||
'Publisher', | |||
'Genre', | |||
'Setting', | |||
'Has game mode', | |||
'Platform', | |||
'Release date', | |||
'System requirements', | |||
'Community links', | |||
} | |||
}, | }, | ||
['These days'] = { | ['These days'] = { | ||
'Multiplayer tools', | heading = 'These days', | ||
template = 'Infobox/These days', | |||
order = '3', | |||
rows = { | |||
'Multiplayer tools', | |||
'Current version', | |||
'Store links' | |||
} | |||
} | } | ||
} | } | ||
return sectionMap | return sectionMap | ||
end | end | ||
| Line 152: | Line 64: | ||
local category = 'Games' | local category = 'Games' | ||
local properties = propertiesPlan() | local properties = propertiesPlan() | ||
local sections = infoboxSectionPlan() | local sections = infoboxSectionPlan() | ||
local | local footer = 'Game footer' | ||
local infobox = utils.createInfobox(frame, category, properties, sections, footer) | |||
local infobox = utils.createInfobox(frame, category, properties | |||
return infobox | return infobox | ||
end | end | ||
return p | return p | ||
Latest revision as of 23:24, 23 March 2026
Documentation for this module may be created at Module:Game/doc
local utils = require( 'Module:Utils' )
local p = {}
local function propertiesPlan()
-- ['Form field name'] = { 'Semantic property', 'delimiter' }
local propMap = {
['Release date'] = {'Has release date' },
['Developer'] = {'Has developer', ',' },
['Publisher'] = {'Has publisher' },
['Series'] = {'Has series', ',' },
['Image'] = {'Image', 'file' },
['Current version'] = {'Has version' },
['Genre'] = {'Has genre', ',' },
['Setting'] = {'Has setting', ',' },
['Has game mode'] = {'Has game mode', ',' },
['Platform'] = {'Has platform', ',' },
['Multiplayer tools'] = {'Has multiplayer tools', ',' }
}
return propMap
end
local function infoboxSectionPlan()
local sectionMap = {
['Cover image'] = {
heading = '',
template = 'Infobox/Cover',
order = '1',
rows = {
'Image'
}
},
['Game Info'] = {
heading = 'Game Info',
template = 'Infobox/Game Info',
order = '2',
rows = {
'Developer',
'Publisher',
'Genre',
'Setting',
'Has game mode',
'Platform',
'Release date',
'System requirements',
'Community links',
}
},
['These days'] = {
heading = 'These days',
template = 'Infobox/These days',
order = '3',
rows = {
'Multiplayer tools',
'Current version',
'Store links'
}
}
}
return sectionMap
end
function p.infobox(frame)
local category = 'Games'
local properties = propertiesPlan()
local sections = infoboxSectionPlan()
local footer = 'Game footer'
local infobox = utils.createInfobox(frame, category, properties, sections, footer)
return infobox
end
return p
