Module:VGcode

local VGcode = {} local getArgs = require('Dev:Arguments').getArgs local data = mw.loadData( 'Module:VGcode/data' ) local logo = mw.loadData( 'Module:GetImage/data' ).Game

-- replaces function VGcode.toTitle (frame) local args = getArgs(frame) return VGcode._toTitle ( args[1] ) end

function VGcode._toTitle ( term ) return data[term] and data[term] or term end

-- replaces function VGcode.toLogo (frame) local invokeargs = getArgs(frame) local nsprefix = invokeargs['nofile'] and '' or 'File:' -- assert( invokeargs[1], 'No primary term given to Vglogo') return VGcode._toLogo ( invokeargs[1], invokeargs[2] or '', nsprefix ) end

function VGcode._toLogo ( term1, term2, nsprefix ) -- assert(term1, 'No input term is given') if type(logo[term1]) == 'string' then return (nsprefix or 'File:') .. logo[term1] elseif type(logo[term1]) == 'table' then return (nsprefix or 'File:') .. (logo[term1][term2] or logo[term1]) else return (nsprefix or 'File:') .. logo[1] end end

return VGcode