Module:Game: Difference between revisions
From PC Gaming Shelter
No edit summary |
No edit summary |
||
| (17 intermediate revisions by the same user not shown) | |||
| Line 21: | Line 21: | ||
end | end | ||
local function | local function infoboxSectionPlan() | ||
local | local sectionMap = { | ||
['Game Info'] = { | |||
heading = 'Game Info', | |||
template = 'Infobox/Game Info', | |||
order = '1', | |||
rows = { | |||
'Developer', | |||
'Publisher', | |||
'Genre', | |||
'Setting', | |||
'Has game mode', | |||
'Platform', | |||
'Release date', | |||
'System requirements' | |||
} | |||
template | |||
}, | }, | ||
{ | ['These days'] = { | ||
heading = 'These days', | |||
template = 'Infobox/These days', | |||
order = '2', | |||
rows = { | |||
'Community links', | |||
'Multiplayer tools', | |||
'Current version', | |||
'Store links' | |||
} | |||
} | } | ||
} | } | ||
return sectionMap | |||
end | end | ||
| Line 134: | Line 56: | ||
local category = 'Games' | local category = 'Games' | ||
local properties = propertiesPlan() | local properties = propertiesPlan() | ||
local | 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 | ||
Revision as of 22:07, 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 = {
['Game Info'] = {
heading = 'Game Info',
template = 'Infobox/Game Info',
order = '1',
rows = {
'Developer',
'Publisher',
'Genre',
'Setting',
'Has game mode',
'Platform',
'Release date',
'System requirements'
}
},
['These days'] = {
heading = 'These days',
template = 'Infobox/These days',
order = '2',
rows = {
'Community links',
'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
