Module:File

local f = {}

function f.main(frame) local result = {} local game = frame:getParent.args["game"] or "" local description = frame:getParent.args["description"] or "" local typegame = mw.ustring.lower(frame:getParent.args["typegame"] or "") local typeself = mw.ustring.lower(frame:getParent.args["typeself"] or "") local user = frame:getParent.args["user"] or "" local source = frame:getParent.args["source"] or nil local artist = frame:getParent.args["artist"] or "" local filename = frame:getParent.args["filename"] or "" local license = frame:getParent.args["license"] or nil function TEXT(X) local audiodialogue = "Audio dialogue" local achievement = "achievement" local trophy = "trophy" local artwork = "artwork" local animated = "Animated image" local addon = "Add-on image" local ammunition = "ammunition" local armorandclothing = "Armor and clothing image" local audio = "Audio file" local beta = "Beta file" local billboard = "Billboard or sign" local boxart = "Box artwork" local bug = "Bug image" local character = "Character image" local concept = "Concept artwork" local creature = "Creature image" local creaturesounds = "Creature sounds" local endingslide = "Ending slide" local graffiti = "Graffiti" local images = "Image" local introslide = "Intro slide" local itemimages = "Item images" local loadingscreen = "Loading screen" local localmap = "Local map image" local icon = "Icon" local logo = "Logo" local location = "Location image" local misc = "Miscellaneous item image" local perk = "Perk image" local perkmag = "Perk magazine image" local pipboy = "Pip-Boy image" local photo = "Real-world photo" local poster = "Poster" local promopub = "Promotional and publishing image" local quest = "Quest image" local randencount = "Random encounter image" local render = "Render image" local robot = "Robot and computer image" local skillicon = "Skill book icon" local skillimage = "Skill book image" local screenshot = "Screenshot" local song = "Song image" local vaultboy = "Vault Boy image" local vehicle = "Vehicle image" local voiceactor = "Voice actor image" local weapon = "Weapon image" local system = "System image" local user = "This file is a personal file belonging to User:".. user .."." local video = "Video" local wiki = "Wiki image" local worldobject = "World object image" local none = " Error: Invalid type entered, please consult the list of types." local t = {} t = { ['audio dialogue'] = audiodialogue, ['audio log'] = audiodialogue, ['audio conversation'] = audiodialogue, ['audiodialogue'] = audiodialogue, ['audiolog'] = audiodialogue,

['trophies'] = trophy, ['trophy'] = trophy,

['art'] = artwork, ['artworks'] = artwork, ['artwork'] = artwork, ['arts'] = artwork,

['anim'] = animated, ['animated'] = animated, ['animation'] = animated, ['animated image'] = animated, ['animated images'] = animated, ['animated img'] = animated,

['add-on'] = addon, ['addon'] = addon, ['add-on image'] = addon, ['addon image'] = addon,

['ammo'] = ammunition, ['ammunition'] = ammunition,

['armor'] = armorandclothing, ['clothing'] = armorandclothing, ['armor and clothing images'] = armorandclothing, ['armor and clothing image'] = armorandclothing, ['armor images'] = armorandclothing, ['clothing images'] = armorandclothing, ['armors'] = armorandclothing, ['clothings'] = armorandclothing, ['sound'] = audio, ['audio file'] = audio, ['audio'] = audio, ['box'] = boxart, ['boxart'] = boxart, ['boxartwork'] = boxart, ['box art'] = boxart, ['box artwork'] = boxart,

['beta image'] = beta, ['pre-release'] = beta, ['prerelease'] = beta, ['early version'] = beta, ['beta'] = beta,

['bill board'] = billboard, ['billboard'] = billboard, ['sign'] = billboard, ['signs'] = billboard, ['insect'] = bug, ['bug image'] = bug, ['insect image'] = bug, ['bug'] = bug,

['characters'] = character, ['character'] = character, ['character image'] = character, ['concept'] = concept, ['conceptart'] = concept, ['conceptartwork'] = concept, ['concept art'] = concept, ['concept artwork'] = concept, ['creatures'] = creature, ['creature'] = creature, ['creature sound'] = creaturesounds, ['creaturesound'] = creaturesounds, ['creature sounds'] = creaturesounds, ['monster'] = creature,

['ending slide'] = endingslide, ['endingslide'] = endingslide, ['ending slides'] = endingslide, ['end slide'] = endingslide, ['intro slide'] = introslide, ['introslide'] = introslide, ['intro'] = introslide, ['intro slides'] = introslide, ['opening slide'] = introslide, ['opening'] = introslide, ['ending'] = endingside,

['item'] = itemimages, ['item images'] = itemimages,

['loading'] = loadingscreen, ['loading screen'] = loadingscreen, ['loadingscreen'] = loadingscreen, ['load screen'] = loadingscreen, ['loadscreen'] = loadingscreen, ['loading screen images'] = loadingscreen,

['local map'] = localmap, ['local maps'] = localmap, ['local map images'] = localmap, ['ico'] = icon, ['icon'] = icon, ['icons'] = icons, ['logo'] = logo, ['logomark'] = logo, ['logos'] = logo, ['logotype'] = logo, ['wordmark'] = logo, ['locations'] = location, ['location'] = location, ['location image'] = location, ['place'] = location, ['places'] = location, ['place images'] = location,

['miscellaneous'] = misc, ['misc item'] = misc, ['misc thing'] = misc, ['miscellaneous item'] = misc, ['miscellaneous item images'] = misc, ['misc'] = misc, ['3dmodel'] = render, ['3d model'] = render, ['model'] = render, ['models'] = render, ['render images'] = render, ['render'] = render,

['perk images'] = perk, ['perk'] = perk, ['perk magazine'] = perkmag, ['perkmagazine'] = perkmag, ['perkmag'] = perkmag, ['perk magazines'] = perkmag, ['perk magazine images'] = perkmag, ['photo'] = photo, ['photos'] = photo, ['photography'] = photo, ['reallife'] = photo, ['real life'] = photo, ['real'] = photo, ['pip-boy'] = pipboy, ['pip boy'] = pipboy, ['pipboy'] = pipboy, ['pip-boy images'] = pipboy, ['pb'] = pipboy, ['pip boy images'] = pipboy,

['prtscr'] = screenshot, ['printscreen'] = screenshot, ['print screen'] = screenshot, ['scr'] = screenshot, ['screen'] = screenshot, ['screenshot'] = screenshot, ['scrshot'] = screenshot, ['screen shot'] = screenshot, ['poster images'] = poster, ['poster'] = poster, ['posters'] = poster, ['sys'] = system, ['sysimg'] = system, ['system'] = system, ['system image'] = system, ['system images'] = system, ['console images'] = system, ['consoles'] = system, ['console'] = system,

['promotional'] = promopub, ['publication'] = promopub, ['promotional and publishing'] = promopub, ['publishing'] = promopub, ['promo'] = promopub, ['ad'] = promopub, ['advertisement'] = promopub, ['advert'] = promopub, ['promotional and publishing images'] = promopub,

['quest images'] = quest, ['quests'] = quest, ['quest'] = quest,

['random encounter'] = randencount, ['randomencounter'] = randencount, ['random encounter images'] = randencount, ['random'] = randencount, ['re'] = randencount,

['robots'] = robot, ['robot'] = robot, ['computer'] = robot, ['computers'] = robot, ['robot and computer'] = robot, ['technology'] = robot, ['robot and computer images'] = robot,

['skill book'] = skillimage, ['skill book icon'] = skillicon, ['skillbook icon'] = skillicon, ['skillbook icon images'] = skillicon, ['skill book icon images'] = skillicon, ['skillbook'] = skillimage, ['skillbook images'] = skillimage, ['skillbook image'] = skillimage, ['skill book images'] = skillimage, ['skill book image'] = skillimage,

['music'] = song, ['song images'] = song, ['songs'] = song, ['song'] = song,

['vb'] = vaultboy, ['vault boy'] = vaultboy, ['vaultboy'] = vaultboy, ['vault-boy'] = vaultboy, ['vault boy images'] = vaultboy,

['car'] = vehicle, ['vehicle'] = vehicle, ['transportation'] = vehicle,

['voice actor'] = voiceactor, ['voiceactor'] = voiceactor, ['va'] = voiceactor, ['voice actor image'] = voiceactor, ['person'] = voiceactor, ['voice actress'] = voiceactor, ['voiceactress'] = voiceactor,

['weapon images'] = weapon, ['weapons'] = weapon, ['weapon'] = weapon,

['world object'] = worldobject, ['wo'] = worldobject, ['world objects'] = worldobject, ['worldobject'] = worldobject, ['personal'] = user, ['personal img'] = user, ['personal image'] = user, ['user'] = user, ['userimg'] = user, ['user image'] = user, ['video'] = video, ['videos'] = video, ['falloutwiki'] = wiki, ['wiki'] = wiki, ['ifw'] = wiki, }		if not t[X] then return none else return t[X] end end function CAT(X,Y) if Y == true then Y = game .. ' ' else Y = "" end local audiodialogue = "" local artwork = "" local logo = "" local trophy = "" local achievement = "" local addon = "" local ammunition = "" local animated = "" local armorandclothing = "" local audio = "" local beta = "" local billboard = "" local boxart = "" local bug = "" local character = "" local concept = "" local creature = "" local creaturesounds = "" local endingslide = "" local graffiti = "" local icon = "" local images = "" local introslide = "" local itemimage = "" local loadingscreen = "" local localmap = "" local location = "" local misc = "" local perk = "" local perkmag = "" local pipboy = "" local poster = "" local promopub = "" local quest = "" local photo = "" local randencount = "" local render = "" local robot = "" local screenshot = "" local skillicon = "" local skillimage = "" local song = "" local vaultboy = "" local system = "" local user = "" local video = "" local wiki = "" local vehicle = "" local voiceactor = "" local weapon = "" local worldobject = "" local none = "" local t = {} t = { ['audio dialogue'] = audiodialogue, ['audio log'] = audiodialogue, ['audio conversation'] = audiodialogue, ['audiodialogue'] = audiodialogue, ['audiolog'] = audiodialogue,

['trophies'] = trophy, ['trophy'] = trophy,

['art'] = artwork, ['artworks'] = artwork, ['artwork'] = artwork, ['arts'] = artwork,

['anim'] = animated, ['animated'] = animated, ['animation'] = animated, ['animated image'] = animated, ['animated images'] = animated, ['animated img'] = animated,

['add-on'] = addon, ['addon'] = addon, ['add-on image'] = addon, ['addon image'] = addon,

['ammo'] = ammunition, ['ammunition'] = ammunition,

['armor'] = armorandclothing, ['clothing'] = armorandclothing, ['armor and clothing images'] = armorandclothing, ['armor and clothing image'] = armorandclothing, ['armor images'] = armorandclothing, ['clothing images'] = armorandclothing, ['armors'] = armorandclothing, ['clothings'] = armorandclothing, ['sound'] = audio, ['audio file'] = audio, ['audio'] = audio, ['box'] = boxart, ['boxart'] = boxart, ['boxartwork'] = boxart, ['box art'] = boxart, ['box artwork'] = boxart,

['beta image'] = beta, ['pre-release'] = beta, ['prerelease'] = beta, ['early version'] = beta, ['beta'] = beta,

['bill board'] = billboard, ['billboard'] = billboard, ['sign'] = billboard, ['signs'] = billboard, ['insect'] = bug, ['bug image'] = bug, ['insect image'] = bug, ['bug'] = bug,

['characters'] = character, ['character'] = character, ['character image'] = character, ['creatures'] = creature, ['creature'] = creature, ['creature sound'] = creaturesounds, ['creaturesound'] = creaturesounds, ['creature sounds'] = creaturesounds, ['monster'] = creature,

['ending slide'] = endingslide, ['endingslide'] = endingslide, ['ending slides'] = endingslide, ['end slide'] = endingslide, ['intro slide'] = introslide, ['introslide'] = introslide, ['intro'] = introslide, ['intro slides'] = introslide, ['opening slide'] = introslide, ['opening'] = introslide, ['ending'] = endingside,

['item'] = itemimages, ['item images'] = itemimages,

['loading'] = loadingscreen, ['loading screen'] = loadingscreen, ['loadingscreen'] = loadingscreen, ['load screen'] = loadingscreen, ['loadscreen'] = loadingscreen, ['loading screen images'] = loadingscreen,

['local map'] = localmap, ['local maps'] = localmap, ['local map images'] = localmap, ['ico'] = icon, ['icon'] = icon, ['icons'] = icons, ['logo'] = logo, ['logomark'] = logo, ['logos'] = logo, ['logotype'] = logo, ['wordmark'] = logo, ['locations'] = location, ['location'] = location, ['location image'] = location, ['place'] = location, ['places'] = location, ['place images'] = location,

['miscellaneous'] = misc, ['misc item'] = misc, ['misc thing'] = misc, ['miscellaneous item'] = misc, ['miscellaneous item images'] = misc, ['misc'] = misc, ['3dmodel'] = render, ['3d model'] = render, ['model'] = render, ['models'] = render, ['render images'] = render, ['render'] = render,

['perk images'] = perk, ['perk'] = perk, ['perk magazine'] = perkmag, ['perkmagazine'] = perkmag, ['perkmag'] = perkmag, ['perk magazines'] = perkmag, ['perk magazine images'] = perkmag, ['photo'] = photo, ['photos'] = photo, ['photography'] = photo, ['reallife'] = photo, ['real life'] = photo, ['real'] = photo, ['pip-boy'] = pipboy, ['pip boy'] = pipboy, ['pipboy'] = pipboy, ['pip-boy images'] = pipboy, ['pb'] = pipboy, ['pip boy images'] = pipboy,

['prtscr'] = screenshot, ['printscreen'] = screenshot, ['print screen'] = screenshot, ['scr'] = screenshot, ['screen'] = screenshot, ['screenshot'] = screenshot, ['scrshot'] = screenshot, ['screen shot'] = screenshot, ['poster images'] = poster, ['poster'] = poster, ['posters'] = poster, ['sys'] = system, ['sysimg'] = system, ['system'] = system, ['system image'] = system, ['system images'] = system, ['console images'] = system, ['consoles'] = system, ['console'] = system,

['promotional'] = promopub, ['publication'] = promopub, ['promotional and publishing'] = promopub, ['publishing'] = promopub, ['promo'] = promopub, ['ad'] = promopub, ['advertisement'] = promopub, ['advert'] = promopub, ['promotional and publishing images'] = promopub,

['quest images'] = quest, ['quests'] = quest, ['quest'] = quest,

['random encounter'] = randencount, ['randomencounter'] = randencount, ['random encounter images'] = randencount, ['random'] = randencount, ['re'] = randencount,

['robots'] = robot, ['robot'] = robot, ['computer'] = robot, ['computers'] = robot, ['robot and computer'] = robot, ['technology'] = robot, ['robot and computer images'] = robot,

['skill book'] = skillimage, ['skill book icon'] = skillicon, ['skillbook icon'] = skillicon, ['skillbook icon images'] = skillicon, ['skill book icon images'] = skillicon, ['skillbook'] = skillimage, ['skillbook images'] = skillimage, ['skillbook image'] = skillimage, ['skill book images'] = skillimage, ['skill book image'] = skillimage,

['music'] = song, ['song images'] = song, ['songs'] = song, ['song'] = song,

['vb'] = vaultboy, ['vault boy'] = vaultboy, ['vaultboy'] = vaultboy, ['vault-boy'] = vaultboy, ['vault boy images'] = vaultboy,

['car'] = vehicle, ['vehicle'] = vehicle, ['transportation'] = vehicle,

['voice actor'] = voiceactor, ['voiceactor'] = voiceactor, ['va'] = voiceactor, ['voice actor image'] = voiceactor, ['person'] = voiceactor, ['voice actress'] = voiceactor, ['voiceactress'] = voiceactor,

['weapon images'] = weapon, ['weapons'] = weapon, ['weapon'] = weapon,

['world object'] = worldobject, ['wo'] = worldobject, ['world objects'] = worldobject, ['worldobject'] = worldobject, ['personal'] = user, ['personal img'] = user, ['personal image'] = user, ['user'] = user, ['userimg'] = user, ['user image'] = user, ['video'] = video, ['videos'] = video, ['falloutwiki'] = wiki, ['wiki'] = wiki, ['ifw'] = wiki, }

if not t[X] then return none else return t[X] end end function SRC(X) local myself = "Media created by the uploader" local user2 = "Media created by ".. user .."" local fandom = "FANDOM image " local youtube = "YouTube image " local presskit = "Press kit image " local missing = " This file is missing a source. " local t = {} t = { ['me'] = myself, ['my'] = myself, ['myself'] = myself, ['self'] = myself,

['other'] = user2, ['someone'] = user2, ['someone else'] = user2, ['user'] = user2, ['gamepedia'] = fandom, ['fandom'] = fandom, ['wikia'] = fandom, ['gamefaqs'] = fandom, ['youtube'] = youtube, ['yt'] = youtube, ['kit'] = presskit, ['press'] = presskit, ['presskit'] = presskit, ['press kit'] = presskit, }		if source and source ~= "" then if not t[X] then return X			else return t[X] end else return missing end end function LIC(X) local ccbysa10 = "This file is distributed under the Creative Commons Attribution-ShareAlike 1.0 license." local ccby20 = "This file is distributed under the Creative Commons Attribution 2.0 license." local ccbysa21jp = "This file is distributed under the Creative Commons Attribution-ShareAlike 2.1 Japan license." local ccby25 = "This file is distributed under the Creative Commons Attribution 2.5 license." local ccbysa25 = "This file is distributed under the Creative Commons Attribution-ShareAlike 2.5 license." local ccby30 = "This file is distributed under the Creative Commons Attribution 3.0 license." local ccbysa30 = "This file is distributed under the Creative Commons Attribution-ShareAlike 3.0 license." local ccbysa40 = "This file is distributed under the Creative Commons Attribution-ShareAlike 4.0 license." local ccbyncsa40 = "This file is distributed under the Creative Commons Attribution-NonCommercial-ShareAlike 4.0 license." local gnu = "This file is distributed under the Gnu Free Documentation License 1.3 license." local perm = "This file has been uploaded with the permission of the copyright holder." local pd = "This file has been released into the public domain by the copyright holder, its copyright has expired, or it is ineligible for copyright. This applies worldwide." local pds = "This file has been released into the public domain by the uploading user. This applies worldwide." local myself = "This file has been uploaded by the photographer, artist or author." local fairuse = "This file is subject to copyright. Copyright is most likely held by the company that published the game or the media portrayed. Fallout Wiki's use of this work qualifies as fair use under United States copyright law, or the author's permission is given. It is used on the wiki only in the belief that the information the file portrays is designed to be an accompaniment to playing the game or media, and its use here will not:Detract from the experience of playing the game or using the media in question.Harm the author's sales or reputation." local t = {} t = { ['ccbysa10'] = ccbysa10, ['ccybysa1.0'] = ccbysa10, ['cc by sa 1.0'] = ccbysa10, ['cc-by-sa-1.0'] = ccbysa10, ['cc-by-sa 1.0'] = ccbysa10, ['ccby20'] = ccby20, ['ccyby2.0'] = ccby20, ['cc by 2.0'] = ccby20, ['cc-by-2.0'] = ccby20, ['cc-by 2.0'] = ccby20, ['ccbysa21jp'] = ccbysa21jp, ['ccybysa2.1jp'] = ccbysa21jp, ['cc by sa 2.1 jp'] = ccbysa21jp, ['cc-by-sa-2.1 jp'] = ccbysa21jp, ['cc-by-sa 2.1 jp'] = ccbysa21jp, ['cc-by-sa 2.1 japan'] = ccbysa21jp, ['ccby25'] = ccby25, ['ccyby2.5'] = ccby25, ['cc by 2.5'] = ccby25, ['cc-by-2.5'] = ccby25, ['cc-by-2.5'] = ccby25, ['ccbysa25'] = ccbysa25, ['ccybysa2.5'] = ccbysa25, ['cc by sa 2.5'] = ccbysa25, ['cc-by-sa-2.5'] = ccbysa25, ['cc-by-sa 2.5'] = ccbysa25, ['ccby30'] = ccbysa30, ['ccyby3.0'] = ccby30, ['cc by 3.0'] = ccby30, ['cc-by-3.0'] = ccby30, ['cc-by-3.0'] = ccby30, ['ccbysa30'] = ccbysa30, ['ccybysa3.0'] = ccbysa30, ['cc by sa 3.0'] = ccbysa30, ['cc-by-sa-3.0'] = ccbysa30, ['cc-by-sa 3.0'] = ccbysa30, ['ccbysa40'] = ccbysa40, ['ccybysa4.0'] = ccbysa40, ['cc by sa 4.0'] = ccbysa40, ['cc-by-sa-4.0'] = ccbysa40, ['cc-by-sa 4.0'] = ccbysa40, ['ccbyncsa40'] = ccbyncsa40, ['ccybyncsa4.0'] = ccbyncsa40, ['cc by nc sa 4.0'] = ccbyncsa40, ['cc-by-nc-sa-4.0'] = ccbyncsa40, ['cc-by-nc-sa 4.0'] = ccbyncsa40, ['gnu'] = gnu, ['gnufdl'] = gnu, ['gnu fdl 1.3'] = gnu, ['fdl'] = gnu, ['gnufdl1.3'] = gnu, ['perm'] = perm, ['permission'] = perm, ['used with permission'] = perm, ['pd'] = pd, ['public'] = pd, ['publicdomain'] = pd, ['public domain'] = pd, ['pds'] = pds, ['publicself'] = pds, ['publicdomain self'] = pds, ['public domain self'] = pds, ['public domain by myself'] = pds, ['myself'] = myself, ['uploader'] = myself, ['author'] = myself, ['creator'] = myself, } if not t[X] then return fairuse else return t[X] end end local panel_typegame = "" local panel_typeself = ""

if not typegame or typegame == "" then typegame = {} else typegame = mw.text.split(typegame, ',%s*') for i = 1, #typegame do typegame[i] = TEXT(typegame[i]) .. CAT(typegame[i],true) end if #typegame > 4 then panel_typegame = ' Type(s) Way too many types! Try using up to 4 types max. '		else panel_typegame = ' Type(s)  '.. table.concat(typegame,", ") ..' ' end end if not typeself or typeself == "" then typeself = {} else typeself = mw.text.split(typeself, ',%s*') for i = 1, #typeself do typeself[i] = TEXT(typeself[i]) .. CAT(typeself[i],false) end if #typeself > 4 then panel_typeself = ' Type(s) Way too many types! Try using up to 4 types max. '		else panel_typeself = ' Type(s)  '.. table.concat(typeself,", ") ..' ' end end local panel_game = ' Game  '.. game ..'  ' local panel_description = ' Description  '.. description ..' ' local panel_user = ' User  '.. user ..'  ' local panel_artist = ' Artist(s)  '.. artist ..' ' local panel_filename = ' Original filename    ' local panel_source = ' Source  '.. SRC(source) ..' ' local panel_license = ' License  '.. LIC(license) ..' ' if game == "" then panel_game = "" end if description == "" then panel_description = "" end if artist == "" then panel_artist = "" end if filename == "" then panel_filename = "" end if user == "" then panel_user = "" end local panel = ' ' table.insert(result, panel) return table.concat(result, "") end

return f