Fallout Wiki
Fallout Wiki
No edit summary
No edit summary
(45 intermediate revisions by the same user not shown)
Line 3: Line 3:
   
 
local gameList = {
 
local gameList = {
['AR'] = "All Roads && All Roads",
+
AR = {
  +
icon = "Gametitle-AR.png",
['D20'] = "Fallout Pen and Paper d20 && Fallout d20",
 
['FB'] = "Fallout Bible",
+
title = "All Roads",
['FBG'] = "Fallout: The Board Game",
+
short = "All Roads"
  +
},
['FBGNC'] = "Fallout: New California",
 
  +
['FBGWW'] = "Fallout: Wasteland Warfare",
 
['FILM'] = "Fallout (film)",
+
D20 = {
['FNV'] = "Fallout: New Vegas",
+
icon = "Gametitle-D20.png",
['FNVCS'] = "Courier's Stash",
+
title = "Fallout Pen and Paper d20",
['FNVDM'] = "Dead Money",
+
link = "Fallout d20",
['FNVGRA'] = "Gun Runners' Arsenal",
+
short = "Fallout d20"
  +
},
['FNVHH'] = "Honest Hearts",
 
  +
['FNVLR'] = "Lonesome Road (add-on) && Lonesome Road",
 
  +
FB = {
['FNVOWB'] = "Old World Blues (add-on) && Old World Blues",
 
['FO4'] = "Fallout 4",
+
icon = "Gametitle-FB.png",
  +
title = "Fallout Bible"
['FO4AUT'] = "Automatron (add-on) && Automatron",
 
  +
},
['FO4WW'] = "Wasteland Workshop",
 
  +
['FO4FH'] = "Far Harbor (add-on) && Far Harbor",
 
  +
FBG = {
['FO4CW'] = "Contraptions Workshop",
 
['FO4VW'] = "Vault-Tec Workshop",
+
icon = "Gametitle-FBG.png",
['FO4NW'] = "Nuka-World (add-on) && Nuka-World",
+
title = "Fallout: The Board Game"
  +
},
['FO4VR'] = "Fallout 4 VR",
 
  +
['FO4CC'] = "Creation Club",
 
  +
FBGNC = {
['FOS'] = "Fallout Shelter",
 
['FPB'] = "Fallout Pip-Boy",
+
icon = "Gametitle-FBGNC.png",
['FO'] = "Fallout",
+
title = "Fallout: New California"
  +
},
['FO1'] = "Fallout",
 
  +
['FO2'] = "Fallout 2",
 
['FO3'] = "Fallout 3",
+
FBGWW = {
['FO3BS'] = "Broken Steel",
+
icon = "Gametitle-FBGWW.png",
  +
title = "Fallout: Wasteland Warfare",
['FO3MZ'] = "Mothership Zeta {add-on) && Mothership Zeta",
 
  +
},
['FO3OA'] = "Operation Anchorage (add-on) && Operation Anchorage",
 
  +
['FO3PL'] = "Point Lookout (add-on) && Point Lookout",
 
  +
FILM = {
['FO3TP'] = "The Pitt (add-on) && The Pitt",
 
['FO76'] = "Fallout 76",
+
icon = "Film.png",
['FO76WA'] = "Wild Appalachia",
+
title = "Fallout (film)"
  +
},
['FO76NW'] = "Nuclear Winter",
 
  +
['FO76WL'] = "Wastelanders",
 
  +
FNV = {
['FOBOS'] = "Fallout: Brotherhood of Steel && Fallout: BoS",
 
  +
icon = "Gametitle-FNV.png",
['FOBOS2'] = "Fallout: Brotherhood of Steel 2 && Fallout: BoS 2",
 
['FOOL'] = "Project V13",
+
title = "Fallout: New Vegas"
  +
},
['PV13'] = "Project V13",
 
  +
['FOT'] = "Fallout Tactics: Brotherhood of Steel && Fallout Tactics",
 
  +
FNVCS = {
['FOT2'] = "Fallout Tactics 2",
 
['FOW'] = "Fallout: Warfare",
+
icon = "Gametitle-FNV_CS.png",
['FOX'] = "Fallout Extreme",
+
title = "Courier's Stash"
  +
},
['FWW'] = "Fallout: Wasteland Warfare",
 
  +
['JES'] = "J.E. Sawyer's Fallout RPG && JES Fallout RPG",
 
['LH'] = "Lionheart",
+
FNVDM = {
  +
icon = "Gametitle-FNV_DM.png",
['PA'] = "One Man, and a Crate of Puppets && Penny Arcade",
 
['TAR'] = "The Armageddon Rag && Armageddon Rag",
+
title = "Dead Money"
['TORN'] = "TORN",
+
},
  +
['VB'] = "Van Buren",
 
  +
FNVGRA = {
['WIKI'] = "Fallout Wiki:About",
 
['NONE'] = "Mentioned-only",
+
icon = "Gametitle-FNV_GRA.png",
['RW'] = "Real world"
+
title = "Gunn Runners' Arsenal"
  +
},
  +
  +
FNVHH = {
  +
icon = "Gametitle-FNV_HH.png",
  +
title = "Honest Hearts"
  +
},
  +
  +
FNVLR = {
  +
icon = "Gametitle-FNV_LR.png",
  +
title = "Lonesome Road (add-on)",
  +
link = "Lonesome Road",
  +
short = "Lonesome Road"
  +
},
  +
  +
FNVOWB = {
  +
icon = "Gametitle-FNV_OWB.png",
  +
title = "Old World Blues (add-on)",
  +
link = "Old World Blues",
  +
short = "Old World Blues"
  +
},
  +
  +
FO4 = {
  +
icon = "Gametitle-FO4.png",
  +
title = "Fallout 4",
  +
},
  +
  +
FO4AUT = {
  +
icon = "Gametitle-FO4_AUT.png",
  +
title = "Automatron (add-on)",
  +
link = "Automatron",
  +
short = "Automatron"
  +
},
  +
  +
FO4WW = {
  +
icon = "Gametitle-FO4_WW.png",
  +
title = "Wasteland Workshop"
  +
},
  +
  +
FO4FH = {
  +
icon = "Gametitle-FO4_FH.png",
  +
title = "Far Harbor (add-on)",
  +
link = "Far Harbor",
  +
short = "Far Harbor"
  +
},
  +
  +
FO4CW = {
  +
icon = "Gametitle-FO4_CW.png",
  +
title = "Contraptions Workshop"
  +
},
  +
  +
FO4VW = {
  +
icon = "Gametitle-FO4_VW.png",
  +
title = "Vault-Tec Workshop"
  +
},
  +
  +
FO4NW = {
  +
icon = "Gametitle-FO4_NW.png",
  +
title = "Nuka-World (add-on)",
  +
link = "Nuka-World",
  +
short = "Nuka-World"
  +
},
  +
  +
FO4VR = {
  +
icon = "Gametitle-FO4VR.png",
  +
title = "Fallout 4 VR"
  +
},
  +
  +
FO4CC = {
  +
icon = "Gametitle-FO4_CC.png",
  +
title = "Creation Club"
  +
},
  +
  +
FOS = {
  +
icon = "Gametitle-FOS.png",
  +
title = "Fallout Shelter",
  +
},
  +
  +
FPB = {
  +
icon = "Gametitle-FPB.png",
  +
title = "Fallout Pip-Boy"
  +
},
  +
  +
FO = {
  +
icon = "Gametitle-FO1.png",
  +
title = "Fallout"
  +
},
  +
  +
FO1 = {
  +
icon = "Gametitle-FO1.png",
  +
title = "Fallout"
  +
},
  +
  +
FO2 = {
  +
icon = "Gametitle-FO2.png",
  +
title = "Fallout 2"
  +
},
  +
  +
FO3 = {
  +
icon = "Gametitle-FO3.png",
  +
title = "Fallout 3"
  +
},
  +
  +
FO3BS = {
  +
icon = "Gametitle-FO3_BS.png",
  +
title = "Broken Steel"
  +
},
  +
  +
FO3MZ = {
  +
icon = "Gametitle-FO3_MZ.png",
  +
title = "Mothership Zeta (add-on)",
  +
link = "Mothership Zeta",
  +
short = "Mothership Zeta"
  +
},
  +
  +
FO3OA = {
  +
icon = "Gametitle-FO3_OA.png",
  +
title = "Operation: Anchorage (add-on)",
  +
link = "Operation: Anchorage",
  +
short = "Operation: Anchorage"
  +
},
  +
  +
FO3PL = {
  +
icon = "Gametitle-FO3_PL.png",
  +
title = "Point Lookout (add-on)",
  +
link = "Point Lookout",
  +
short = "Point Lookout"
  +
},
  +
  +
FO3TP = {
  +
icon = "Gametitle-FO3_TP.png",
  +
title = "The Pitt (add-on)",
  +
link = "The Pitt",
  +
short = "The Pitt"
  +
},
  +
  +
FO76 = {
  +
icon = "Gametitle-FO76.png",
  +
title = "Fallout 76"
  +
},
  +
  +
FO76WA = {
  +
icon = "Gametitle-FO76_WA.png",
  +
title = "Wild Appalachia"
  +
},
  +
  +
FO76NW = {
  +
icon = "Gametitle-FO76_NW.png",
  +
title = "Nuclear Winter"
  +
},
  +
  +
FO76WL = {
  +
icon = "Gametitle-FO76_WL.png",
  +
title = "Wastelanders"
  +
},
  +
  +
FOBOS = {
  +
icon = "Gametitle-FOBOS.png",
  +
title = "Fallout: Brotherhood of Steel",
  +
link = "Fallout: Brotherhood of Steel",
  +
short = "Fallout: BoS"
  +
},
  +
  +
FOBOS2 = {
  +
icon = "Gametitle-FOBOS2.png",
  +
title = "Fallout: Brotherhood of Steel 2",
  +
link = "Fallout: Brotherhood of Steel 2",
  +
short = "Fallout: BoS 2"
  +
},
  +
  +
FOOL = {
  +
icon = "PV13.png",
  +
title = "Project V13"
  +
},
  +
  +
PV13 = {
  +
icon = "PV13.png",
  +
title = "Project V13"
  +
},
  +
  +
FOT = {
  +
icon = "Gametitle-FOT.png",
  +
title = "Fallout Tactics: Brotherhood of Steel",
  +
link = "Fallout Tactics",
  +
short = "Fallout Tactics"
  +
},
  +
  +
FOT2 = {
  +
icon = "Gametitle-FOT2.png",
  +
title = "Fallout Tactics 2"
  +
},
  +
  +
FOW = {
  +
icon = "Gametitle-FOW.png",
  +
title = "Fallout: Warfare"
  +
},
  +
  +
FOX = {
  +
icon = "Gametitle-FOX.png",
  +
title = "Fallout Extreme"
  +
},
  +
  +
FWW = {
  +
icon = "Gametitle-FWW.png",
  +
title = "Fallout: Wasteland Warfare"
  +
},
  +
  +
JES = {
  +
icon = "Gametitle-JES.png",
  +
title = "J.E. Sawyer's Fallout RPG",
  +
short = "JES Fallout RPG"
  +
},
  +
  +
LH = {
  +
icon = "Gametitle-LH.png",
  +
title = "Lionheart"
  +
},
  +
  +
PA = {
  +
icon = "Penny Arcade.gif",
  +
title = "One Man, and a Crate of Puppets",
  +
short = "Penny Arcade"
  +
},
  +
  +
TAR = {
  +
icon = "Gametitle-TAR.jpg",
  +
title = "The Armageddon Rag",
  +
short = "Armageddon Rag"
  +
},
  +
  +
TORN = {
  +
icon = "Gametitle-TORN.png",
  +
title = "TORN"
  +
},
  +
  +
VB = {
  +
icon = "Gametitle-VB.png",
  +
title = "Van Buren"
  +
},
  +
  +
WIKI = {
  +
icon = "Gametitle-Wiki.png",
  +
title = "Fallout Wiki:About",
  +
short = "Nukapedia"
  +
},
  +
  +
NONE = {
  +
title = "mentioned-only"
  +
},
  +
  +
RW = {
  +
title = "real world"
  +
}
 
}
 
}
   
function abbOnly(abbGames, mode, abbLength)
+
function setTable(keys)
  +
if string.len(tostring(keys)) > 0 then
local gamesCount = 1
 
local gameOut = ""
+
result = mw.text.split(keys, ",")
  +
else
  +
result = nil
  +
end
  +
return result
  +
end
  +
  +
function p.validation(frame)
  +
local keys = setTable(frame.args['games'])
  +
local i = 1
  +
local result = 0
 
 
while gamesCount <= abbLength do
+
while i <= table.getn(keys) do
local activeGame = abbGames[gamesCount]
+
if gameList[keys[i]] ~=nil then
  +
result = result + 1
local gameText = mw.text.split(gameList[activeGame], " && ")
 
 
if mode == "link" or mode == "text" or mode == nil then
 
gameOut = gameOut .. gameText[1]
 
else
 
if gameText[2] ~= nil then
 
gameOut = gameOut .. gameText[2]
 
else
 
gameOut = gameOut .. gameText[1]
 
end
 
 
end
 
end
+
i = i + 1
if gamesCount ~= abbLength then
 
gameOut = gameOut .. " "
 
end
 
 
gamesCount = gamesCount + 1
 
 
end
 
end
+
return result
  +
end
if gameOut == nil then
 
gameOut = "Failed"
 
end
 
return gameOut
 
   
  +
function icon(frame)
  +
local fileCount = 1
  +
local fileOut = ""
  +
while fileCount <= abbLength do
  +
currentFile = string.upper(abbGames[fileCount])
  +
currentFile = abbIcon[currentFile]
  +
if currentFile ~= nil then
  +
fileOut = fileOut .. currentFile
  +
end
  +
fileCount = fileCount + 1
  +
end
  +
return fileOut
 
end
 
end
   
function abbIcon(abbGames, abbLength, abbSize)
+
function p.category(frame)
local icons = require("Module:Icons")
+
local keys = setTable(frame.args['games'])
local iconCount = 1
+
local category = frame.args['category']
local iconOut = ""
+
local prepend = frame.args['prepend']
  +
local append = frame.args['append']
  +
local mode = frame.args['mode']
  +
local sortKey = frame.args['sort key']
  +
local i = 1
  +
local result = ""
 
 
while iconCount <= abbLength do
+
if keys ~= nil then
currentIcon = abbGames[iconCount]
+
while i <= table.getn(keys) do
  +
local currentCat = nil
currentIcon = icons.gameIcon[currentIcon]
 
+
currentCat = keys[i]
if currentIcon ~= nil then
+
if gameList[currentCat]['link'] ~= nil then
iconOut = "[[file:" .. currentIcon .."|" .. icons.iconSize[abbSize] .. "]]"
+
currentCat = gameList[currentCat]['link']
  +
else
  +
currentCat = gameList[currentCat]['title']
  +
end
  +
  +
result = result .. "[[Category:"
  +
  +
if string.lower(mode) == "append" then
  +
result = result .. string.lower(category) .. " "
  +
if prepend ~= nil then
  +
result = result .. prepend
  +
end
  +
  +
result = result .. currentCat
  +
  +
if append ~= nil then
  +
result = result .. append
  +
end
  +
else
  +
result = result .. currentCat .. " "
  +
  +
if prepend ~= nil then
  +
result = result .. " " .. prepend
  +
end
  +
  +
result = result .. category
  +
  +
if append ~= nil then
  +
result = result .. append
  +
end
  +
end
  +
  +
if sortKey ~= nil and string.len(sortKey) ~= 0 then
  +
result = result .. "|" .. sortKey
  +
end
  +
  +
result = result .. "]]"
  +
i = i + 1
 
end
 
end
  +
else
  +
result = "[[Category:" .. category
 
 
if iconCount ~= abbLength then
+
if sortKey ~= nil and string.len(sortKey) ~= 0 then
iconOut = iconOut .. " "
+
result = result .. "|" .. sortKey
 
end
 
end
 
 
iconCount = IconCount + 1
+
result = result .. "]]"
 
end
 
end
  +
  +
return result
 
end
 
end
   
Line 126: Line 429:
 
end
 
end
   
if mode == "icon" then
+
if mode == "cat" then
if frame.args[3] ~= nil then
+
abbCatName = frame.args[3]
abbSize = tostring(frame.args[3])
+
abbAppend = frame.args[4]
else
+
abbPrepend = frame.args[5]
abbSize = "medium"
+
abbCatMode = frame.args[6]
end
+
abbSort = frame.args[7]
  +
result = abbCategory(games, length, abbCatName, abbAppend, abbPrepend, abbCatMode, abbSort)
 
result = abbIcon(games, length, abbSize)
 
 
end
 
end
   
  +
if mode == "icon" then
return result
 
  +
result = abbFile(games, length)
end
 
  +
end
 
function p.loaded()
 
result = package.loaded
 
 
return result
 
return result
 
end
 
end

Revision as of 22:09, 9 June 2019


Auxiliary template for {{Infobox}}.

Usage

{{abb|abbreviation}}

Parameters

Small template which retrieves the name of a ''Fallout'' game for a given user entry.

Template parameters

ParameterDescriptionTypeStatus
Abb1 abb

Game abbrevation; see Template:Abb for list of valid inputs.

Stringrequired
Modemode

Determines the template output.

Example
Available options: icon, link, short, text
Stringrequired

Available options for {{{mode|}}}

  • icon: Returns the name of the game's icon (without "File:" prefix).
  • link: Returns the name of the game's overview article.
  • short: Returns a shortened version of the game's name for display in narrow spaces.
  • text: Returns the game's name.

Abbreviations

Abbreviation text short link icon
AR All Roads All Roads All Roads Gametitle-AR
D20 Fallout Pen and Paper d20 Fallout d20 Fallout Pen and Paper d20 Gametitle-D20
FB Fallout Bible Fallout Bible Fallout Bible Gametitle-FB
FBG Fallout: The Board Game Fallout: The Board Game Fallout: The Board Game Gametitle-FBG
FSBG Fallout Shelter: The Board Game Fallout Shelter: The Board Game Fallout Shelter: The Board Game Gametitle-FBG
FBGNC Fallout: New California Fallout: New California Fallout: New California Gametitle-FBGNC
FILM Fallout (film) Fallout (film) Fallout (film) Film
FNV Fallout: New Vegas Fallout: New Vegas Fallout: New Vegas Gametitle-FNV
FNVCS Courier's Stash Courier's Stash Courier's Stash Gametitle-FNV CS
FNVDM Dead Money Dead Money Dead Money Gametitle-FNV DM
FNVHH Honest Hearts Honest Hearts Honest Hearts Gametitle-FNV HH
FNVGRA Gun Runners' Arsenal Gun Runners' Arsenal Gun Runners' Arsenal Gametitle-FNV GRA
FNVLR Lonesome Road Lonesome Road Lonesome Road (add-on) Gametitle-FNV LR
FNVOWB Old World Blues Old World Blues Old World Blues (add-on) Gametitle-FNV OWB
FO4 Fallout 4 Fallout 4 Fallout 4 Gametitle-FO4
FO4AUT Automatron Automatron Automatron (add-on) Gametitle-FO4 AUT
FO4WW Wasteland Workshop Wasteland Workshop Wasteland Workshop Gametitle-FO4 WW
FO4FH Far Harbor Far Harbor Far Harbor (add-on) Gametitle-FO4 FH
FO4CW Contraptions Workshop Contraptions Workshop Contraptions Workshop Gametitle-FO4 CW
FO4VW Vault-Tec Workshop Vault-Tec Workshop Vault-Tec Workshop Gametitle-FO4 VW
FO4NW Nuka-World Nuka-World Nuka-World (add-on) Gametitle-FO4 NW
FO4VR Fallout 4 VR Fallout 4 VR Fallout 4 VR Gametitle-FO4VR
FO4CC Creation Club Creation Club Creation Club Gametitle-FO4 CC
FO76 Fallout 76 Fallout 76 Fallout 76 Gametitle-FO76
FO76WA Wild Appalachia Wild Appalachia Wild Appalachia Gametitle-FO76 WA
FO76NW Nuclear Winter Nuclear Winter Nuclear Winter Gametitle-FO76 NW
FO76WL Wastelanders Wastelanders Wastelanders Gametitle-FO76 WL
FO76LR The Legendary Run The Legendary Run The Legendary Run (update) Gametitle-FO76 LR
FO76OW One Wasteland For All One Wasteland One Wasteland For All Gametitle-FO76 One Wasteland
FO76SD Steel Dawn Steel Dawn Steel Dawn Gametitle-FO76 Steel Dawn
FO76LL Locked & Loaded Locked & Loaded Locked & Loaded Gametitle-FO76 Locked n Loaded
FO76SR Steel Reign Steel Reign Steel Reign Gametitle-FO76 Steel Reign
FO76FW Fallout Worlds Fallout Worlds Fallout Worlds (update) Gametitle-FO76 FW
FO76NM Night of the Moth Night of the Moth Night of the Moth Gametitle-FO76 NM
FO76IB Invaders from Beyond Invaders from Beyond Invaders from Beyond (update) Gametitle-FO76 IB
FO76TM Test Your Metal Test Your Metal Test Your Metal (update) Gametitle-FO76 TM
FO76TP Expeditions: The Pitt Expeditions: The Pitt Expeditions: The Pitt Gametitle-FO76 TP
FO76NT Nuka-World on Tour Nuka-World on Tour Nuka-World on Tour (update) Gametitle-FO76 NT
FO76MI Mutation Invasion Mutation Invasion Mutation Invasion Gametitle-FO76MI
FO76OB Once in a Blue Moon Once in a Blue Moon Once in a Blue Moon Gametitle-FO76 OB
FO76AC Expeditions: Atlantic City Expeditions: Atlantic City Expeditions: Atlantic City Gametitle-FO76 AC
FOS Fallout Shelter Fallout Shelter Fallout Shelter Gametitle-FOS
FOSO Fallout Shelter Online Fallout Shelter Online Fallout Shelter Online Gametitle-FOSO
FPB Fallout Pip-Boy Fallout Pip-Boy Fallout Pip-Boy Gametitle-FPB
FO1 Fallout Fallout Fallout Gametitle-FO1
FO2 Fallout 2 Fallout 2 Fallout 2 Gametitle-FO2
FO3 Fallout 3 Fallout 3 Fallout 3 Gametitle-FO3
FO3BS Broken Steel Broken Steel Broken Steel Gametitle-FO3 BS
FO3MZ Mothership Zeta Mothership Zeta Mothership Zeta (add-on) Gametitle-FO3 MZ
FO3OA Operation: Anchorage Operation: Anchorage Operation: Anchorage (add-on) Gametitle-FO3 OA
FO3PL Point Lookout Point Lookout Point Lookout (add-on) Gametitle-FO3 PL
FO3TP The Pitt The Pitt The Pitt (add-on) Gametitle-FO3 TP
FOBOS Fallout: Brotherhood of Steel Fallout: BoS Fallout: Brotherhood of Steel Gametitle-FOBOS
FOBOS2 Fallout: Brotherhood of Steel 2 Fallout: BoS 2 Fallout: Brotherhood of Steel 2 Gametitle-FOBOS2
PV13 Project V13 Project V13 Project V13 PV13
FOT Fallout Tactics Fallout Tactics Fallout Tactics: Brotherhood of Steel Gametitle-FOT
FOT2 Fallout Tactics 2 Fallout Tactics 2 Fallout Tactics 2 Gametitle-FOT2
FOTV Fallout TV series Fallout (TV series) Fallout (TV series) Title icon Fallout TV
FOW Fallout: Warfare Fallout: Warfare Fallout: Warfare Gametitle-FOW
FOX Fallout Extreme Fallout Extreme Fallout Extreme Gametitle-FOX
FOWW Fallout: Wasteland Warfare Fallout: Wasteland Warfare Fallout: Wasteland Warfare Gametitle-FWW
FOWWRPG Fallout: Wasteland Warfare Roleplaying Game Fallout: Wasteland Warfare Roleplaying Game Fallout: Wasteland Warfare Roleplaying Game Gametitle-FWWRPG
FORPG Fallout: The Roleplaying Game Fallout: The Roleplaying Game Fallout: The Roleplaying Game Gametitle-2D20
FORPGWOA Winter of Atom Winter of Atom Winter of Atom Gametitle-2D20
JES J.E. Sawyer's Fallout RPG JES Fallout RPG J.E. Sawyer's Fallout RPG Gametitle-JES
PA One Man, and a Crate of Puppets Penny Arcade One Man, and a Crate of Puppets Penny Arcade
TAR The Armageddon Rag Armageddon Rag The Armageddon Rag Gametitle-TAR
VB Van Buren Van Buren Van Buren Gametitle-VB
Wiki Nukapedia Nukapedia Fallout Wiki:About Gametitle-Wiki
none mentioned-only mentioned-only


Adding new abbrevations

New abbreviations need adding to Module:Abb/data

Please note:

  • The abbreviation needs to be in all-uppercase.
  • Icon file names should be specified without "File:" prefix.

In addition, please try to maintain alphabetical order of abbreviations within the template.

Examples

Input Result
{{abb|FO3MZ}} Mothership Zeta
{{abb|mode=short|FO3MZ}} Mothership Zeta
{{abb|mode=link|FO3MZ}} Mothership Zeta (add-on)
{{abb|mode=icon|FO3MZ}} Gametitle-FO3_MZ.png

local p = {}

local gameList = {
    AR = {
        icon  = "Gametitle-AR.png",
        title = "All Roads",
        short = "All Roads"
    },

    D20 = {
        icon  = "Gametitle-D20.png",
        title = "Fallout Pen and Paper d20",
        link  = "Fallout d20",
        short = "Fallout d20"
    },

    FB = {
        icon  = "Gametitle-FB.png",
        title = "Fallout Bible"
    },

    FBG = {
        icon  = "Gametitle-FBG.png",
        title = "Fallout: The Board Game"
    },

    FBGNC = {
        icon  = "Gametitle-FBGNC.png",
        title = "Fallout: New California"
    },
    
    FBGWW = {
        icon  = "Gametitle-FBGWW.png",
        title = "Fallout: Wasteland Warfare",
    },
    
    FILM = {
        icon  = "Film.png",
        title = "Fallout (film)"
    },

    FNV = {
        icon  = "Gametitle-FNV.png",
        title = "Fallout: New Vegas"
    },
    
    FNVCS = {
        icon  = "Gametitle-FNV_CS.png",
        title = "Courier's Stash"
    },

    FNVDM = {
        icon  = "Gametitle-FNV_DM.png",
        title = "Dead Money"
    },
    
    FNVGRA = {
        icon  = "Gametitle-FNV_GRA.png",
        title = "Gunn Runners' Arsenal"
    },

    FNVHH = {
        icon  = "Gametitle-FNV_HH.png",
        title = "Honest Hearts"
    },

    FNVLR = {
        icon  = "Gametitle-FNV_LR.png",
        title = "Lonesome Road (add-on)",
        link  = "Lonesome Road",
        short = "Lonesome Road"
    },

    FNVOWB = {
        icon  = "Gametitle-FNV_OWB.png",
        title = "Old World Blues (add-on)",
        link  = "Old World Blues",
        short = "Old World Blues"
    },

    FO4 = {
        icon  = "Gametitle-FO4.png",
        title = "Fallout 4",
    },

    FO4AUT = {
        icon  = "Gametitle-FO4_AUT.png",
        title = "Automatron (add-on)",
        link  = "Automatron",
        short = "Automatron"
    },

    FO4WW = {
        icon  = "Gametitle-FO4_WW.png",
        title = "Wasteland Workshop"
    },

    FO4FH = {
        icon  = "Gametitle-FO4_FH.png",
        title = "Far Harbor (add-on)",
        link  = "Far Harbor",
        short = "Far Harbor"
    },

    FO4CW = {
        icon  = "Gametitle-FO4_CW.png",
        title = "Contraptions Workshop"
    },

    FO4VW = {
        icon  = "Gametitle-FO4_VW.png",
        title = "Vault-Tec Workshop"
    },

    FO4NW = {
        icon  = "Gametitle-FO4_NW.png",
        title = "Nuka-World (add-on)",
        link  = "Nuka-World",
        short = "Nuka-World"
    },

    FO4VR = {
        icon  = "Gametitle-FO4VR.png",
        title = "Fallout 4 VR"
    },

    FO4CC = {
        icon  = "Gametitle-FO4_CC.png",
        title = "Creation Club"
    },
    
    FOS = {
        icon  = "Gametitle-FOS.png",
        title = "Fallout Shelter",
    },

    FPB = {
        icon  = "Gametitle-FPB.png",
        title = "Fallout Pip-Boy"
    },

    FO = {
        icon  = "Gametitle-FO1.png",
        title = "Fallout"
    },

    FO1 = {
        icon  = "Gametitle-FO1.png",
        title = "Fallout"
    },

    FO2 = {
        icon  = "Gametitle-FO2.png",
        title = "Fallout 2"
    },

    FO3 = {
        icon  = "Gametitle-FO3.png",
        title = "Fallout 3"
    },   

    FO3BS = {
        icon  = "Gametitle-FO3_BS.png",
        title = "Broken Steel"
    },

    FO3MZ = {
        icon  = "Gametitle-FO3_MZ.png",
        title = "Mothership Zeta (add-on)",
        link  = "Mothership Zeta",
        short = "Mothership Zeta"
    },

    FO3OA = {
        icon  = "Gametitle-FO3_OA.png",
        title = "Operation: Anchorage (add-on)",
        link  = "Operation: Anchorage",
        short = "Operation: Anchorage"
    },

    FO3PL = {
        icon  = "Gametitle-FO3_PL.png",
        title = "Point Lookout (add-on)",
        link  = "Point Lookout",
        short = "Point Lookout"
    },

    FO3TP = {
        icon  = "Gametitle-FO3_TP.png",
        title = "The Pitt (add-on)",
        link  = "The Pitt",
        short = "The Pitt"
    },

    FO76 = {
        icon  = "Gametitle-FO76.png",
        title = "Fallout 76"
    },

    FO76WA = {
        icon  = "Gametitle-FO76_WA.png",
        title = "Wild Appalachia"
    },

    FO76NW = {
        icon  = "Gametitle-FO76_NW.png",
        title = "Nuclear Winter"
    },
 
    FO76WL = {
        icon  = "Gametitle-FO76_WL.png",
        title = "Wastelanders"
    },

    FOBOS = {
        icon  = "Gametitle-FOBOS.png",
        title = "Fallout: Brotherhood of Steel",
        link  = "Fallout: Brotherhood of Steel",
        short = "Fallout: BoS"
    },

    FOBOS2 = {
        icon  = "Gametitle-FOBOS2.png",
        title = "Fallout: Brotherhood of Steel 2",
        link  = "Fallout: Brotherhood of Steel 2",
        short = "Fallout: BoS 2"
    },

    FOOL = {
        icon  = "PV13.png",
        title = "Project V13"
    },

    PV13 = {
        icon  = "PV13.png",
        title = "Project V13"
    },

    FOT = {
        icon  = "Gametitle-FOT.png",
        title = "Fallout Tactics: Brotherhood of Steel",
        link  = "Fallout Tactics",
        short = "Fallout Tactics"
    },
    
    FOT2 = {
        icon  = "Gametitle-FOT2.png",
        title = "Fallout Tactics 2"
    },

    FOW = {
        icon  = "Gametitle-FOW.png",
        title = "Fallout: Warfare"
    },

    FOX = {
        icon  = "Gametitle-FOX.png",
        title = "Fallout Extreme"
    },

    FWW = {
        icon  = "Gametitle-FWW.png",
        title = "Fallout: Wasteland Warfare"
    },
    
    JES = {
        icon  = "Gametitle-JES.png",
        title = "J.E. Sawyer's Fallout RPG",
        short = "JES Fallout RPG"
    },

    LH = {
        icon  = "Gametitle-LH.png",
        title = "Lionheart"
    },

    PA = {
        icon  = "Penny Arcade.gif",
        title = "One Man, and a Crate of Puppets",
        short = "Penny Arcade"
    },

    TAR = {
        icon  = "Gametitle-TAR.jpg",
        title = "The Armageddon Rag",
        short = "Armageddon Rag"
    },
    
    TORN = {
        icon  = "Gametitle-TORN.png",
        title = "TORN"
    },
    
    VB = {
        icon  = "Gametitle-VB.png",
        title = "Van Buren"
    },

    WIKI = {
        icon  = "Gametitle-Wiki.png",
        title = "Fallout Wiki:About",
        short = "Nukapedia"
    },
    
    NONE = {
        title = "mentioned-only"
    },

    RW = {
        title = "real world"
    }
}

function setTable(keys)
    if string.len(tostring(keys)) > 0 then
        result = mw.text.split(keys, ",")
    else
        result = nil
    end
    return result
end

function p.validation(frame)
    local keys = setTable(frame.args['games'])
    local i = 1
    local result = 0
    
    while i <= table.getn(keys) do
        if gameList[keys[i]] ~=nil then
            result = result + 1
        end
        i = i + 1
    end
    return result
end

function icon(frame)
    local fileCount = 1
    local fileOut = ""
    while fileCount <= abbLength do
        currentFile = string.upper(abbGames[fileCount])
        currentFile = abbIcon[currentFile]
        if currentFile ~= nil then
            fileOut = fileOut .. currentFile
        end
        fileCount = fileCount + 1
    end
    return fileOut
end

function p.category(frame)
    local keys = setTable(frame.args['games'])
    local category = frame.args['category']
    local prepend = frame.args['prepend']
    local append = frame.args['append']
    local mode = frame.args['mode']
    local sortKey = frame.args['sort key']
    local i = 1
    local result = ""
    
    if keys ~= nil then
        while i <= table.getn(keys) do
            local currentCat = nil
            currentCat = keys[i]
            if gameList[currentCat]['link'] ~= nil then
                currentCat = gameList[currentCat]['link']
            else
                currentCat = gameList[currentCat]['title']
            end
            
            result = result .. "[[Category:"

            if string.lower(mode) == "append" then
                result = result .. string.lower(category) .. " "
                if prepend ~= nil then
                    result = result .. prepend
                end

                result = result .. currentCat

                if append ~= nil then
                    result = result .. append
                end
            else
                result = result .. currentCat .. " "
                
                if prepend ~= nil then
                    result = result .. " " .. prepend
                end
            
                result = result .. category
                
                if append ~= nil then
                    result = result .. append
                end
            end

            if sortKey ~= nil and string.len(sortKey) ~= 0 then
                result = result .. "|" .. sortKey
            end
            
            result = result .. "]]"
            i = i + 1
        end
    else
        result = "[[Category:" .. category
        
        if sortKey ~= nil and string.len(sortKey) ~= 0 then
                result = result .. "|" .. sortKey
        end
        
        result = result .. "]]"
    end
    
    return result
end

function p.abb(frame)
    if frame.args[2] ~= nil then
        mode = string.lower(frame.args[2])
    end
    
    local games = string.upper(tostring(frame.args[1]))
    games = mw.text.split(games, ",")
    length = table.getn(games)
    if mode == "link" or mode == "text" or mode == "short" or mode == nil then
        result = abbOnly(games, mode, length)
    end

    if mode == "cat" then
        abbCatName = frame.args[3]
        abbAppend = frame.args[4]
        abbPrepend = frame.args[5]
        abbCatMode = frame.args[6]
        abbSort = frame.args[7]
        result = abbCategory(games, length, abbCatName, abbAppend, abbPrepend, abbCatMode, abbSort)
    end

    if mode == "icon" then
        result = abbFile(games, length)
    end
    return result
end

return p