Module:Gamebox

local getArgs = require('Module:Arguments').getArgs local p = {} local function makeInvokeFunction(funcName) -- makes a function that can be returned from #invoke, using -- Module:Arguments. return function (frame) local args = getArgs(frame, {parentOnly = true}) return p[funcName](args) end end

p.box = makeInvokeFunction('_box') function p._box(args) local class = args[1] or args.class local image = args[2] or args.image local image_width = args[3] or args.image_width if not image_width then image_width = '240px' end local image_bg = args[4] or args.image_bg if not image_bg then image_bg = '#333' end local japan = args[5] or args.japan local romaji = args[6] or args.romaji local developer = args[7] or args.developer local publisher = args[8] or args.publisher local genre = args[9] or args.genre local platform = args[10] or args['platform(s)'] or args.platform local releasej = args[11] or args['release-date-japan'] or args.releasej local releasena = args[12] or args['release-date-north-america'] or args.releasena local releaseeu = args[13] or args['release-date-europe'] or args.releaseeu local releaseau = args[14] or args['release-date-australasia'] or args.releaseau local stylet = '\n|-\n|style="font-size:100%; text-align:center;background:#222;|" colspan=2' local styleh = '\n|-\n!style="background:#111;color:#fff"|' local stylec = '\n|-\n!colspan=2|' local result result = '{|class="customtable ' .. class .. '" style="background: #333; width:250px; font-size:90%; border:3px solid #000; border-radius:7px; float: right; padding: 0px; margin-left:10px" |\n! colspan="2" style="; border-radius:3.5px; padding: 2px 15px; text-align: center;"| ''' .. mw.title.getCurrentTitle .. '''\n|-\n| style="border-radius:3.5px; background:' .. image_bg .. '" colspan="2" align="center" | ' if japan then japan = stylet .. japan else japan = '' end if romaji then romaji = stylet .. romaji else romaji = '' end result = result .. japan .. romaji .. stylec .. 'Game Information' if developer then developer = styleh .. 'Developer\n|' .. developer else developer = '' end if publisher then publisher = styleh .. 'Publisher\n|' .. publisher else publisher = '' end if genre then genre = styleh .. 'Genre\n|' .. genre else genre = '' end if platform then platform = styleh .. 'Platform\n|' .. platform else platform = '' end result = result .. developer .. publisher .. genre .. platform .. stylec .. 'Release Dates' if releasej then releasej = styleh .. '\n|' .. releasej else releasej = '' end if releasena then releasena = styleh .. '\n|' .. releasena else releasena = '' end if releaseeu then releaseeu = styleh .. '\n|' .. releaseeu else releaseeu = '' end if releaseau then releaseau = styleh .. '\n|' .. releaseau else releaseau = '' end result = result .. release-j .. release-na .. release-eu .. release-au '|}' end

return p

--