No edit summary |
No edit summary |
||
Line 75: | Line 75: | ||
gameOut = gameOut .. gameText[1] .. " " |
gameOut = gameOut .. gameText[1] .. " " |
||
else |
else |
||
− | if gameText[ |
+ | if gameText[1] ~= nil then |
gameOut = gameOut .. gameText[1] .. " " |
gameOut = gameOut .. gameText[1] .. " " |
||
else |
else |
Revision as of 13:24, 7 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.
Parameter | Description | Type | Status | |
---|---|---|---|---|
Abb | 1 abb | Game abbrevation; see Template:Abb for list of valid inputs. | String | required |
Mode | mode | Determines the template output.
| String | required |
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 | |
D20 | Fallout Pen and Paper d20 | Fallout d20 | Fallout Pen and Paper d20 | |
FB | Fallout Bible | Fallout Bible | Fallout Bible | |
FBG | Fallout: The Board Game | Fallout: The Board Game | Fallout: The Board Game | |
FSBG | Fallout Shelter: The Board Game | Fallout Shelter: The Board Game | Fallout Shelter: The Board Game | |
FBGNC | Fallout: New California | Fallout: New California | Fallout: New California | |
FILM | Fallout (film) | Fallout (film) | Fallout (film) | |
FNV | Fallout: New Vegas | Fallout: New Vegas | Fallout: New Vegas | |
FNVCS | Courier's Stash | Courier's Stash | Courier's Stash | |
FNVDM | Dead Money | Dead Money | Dead Money | |
FNVHH | Honest Hearts | Honest Hearts | Honest Hearts | |
FNVGRA | Gun Runners' Arsenal | Gun Runners' Arsenal | Gun Runners' Arsenal | |
FNVLR | Lonesome Road | Lonesome Road | Lonesome Road (add-on) | |
FNVOWB | Old World Blues | Old World Blues | Old World Blues (add-on) | |
FO4 | Fallout 4 | Fallout 4 | Fallout 4 | |
FO4AUT | Automatron | Automatron | Automatron (add-on) | |
FO4WW | Wasteland Workshop | Wasteland Workshop | Wasteland Workshop | |
FO4FH | Far Harbor | Far Harbor | Far Harbor (add-on) | |
FO4CW | Contraptions Workshop | Contraptions Workshop | Contraptions Workshop | |
FO4VW | Vault-Tec Workshop | Vault-Tec Workshop | Vault-Tec Workshop | |
FO4NW | Nuka-World | Nuka-World | Nuka-World (add-on) | |
FO4VR | Fallout 4 VR | Fallout 4 VR | Fallout 4 VR | |
FO4CC | Creation Club | Creation Club | Creation Club | |
FO76 | Fallout 76 | Fallout 76 | Fallout 76 | |
FO76WA | Wild Appalachia | Wild Appalachia | Wild Appalachia | |
FO76NW | Nuclear Winter | Nuclear Winter | Nuclear Winter | |
FO76WL | Wastelanders | Wastelanders | Wastelanders | |
FO76LR | The Legendary Run | The Legendary Run | The Legendary Run (update) | |
FO76OW | One Wasteland For All | One Wasteland | One Wasteland For All | |
FO76SD | Steel Dawn | Steel Dawn | Steel Dawn | |
FO76LL | Locked & Loaded | Locked & Loaded | Locked & Loaded | |
FO76SR | Steel Reign | Steel Reign | Steel Reign | |
FO76FW | Fallout Worlds | Fallout Worlds | Fallout Worlds (update) | |
FO76NM | Night of the Moth | Night of the Moth | Night of the Moth | |
FO76IB | Invaders from Beyond | Invaders from Beyond | Invaders from Beyond (update) | |
FO76TM | Test Your Metal | Test Your Metal | Test Your Metal (update) | |
FO76TP | Expeditions: The Pitt | Expeditions: The Pitt | Expeditions: The Pitt | |
FO76NT | Nuka-World on Tour | Nuka-World on Tour | Nuka-World on Tour (update) | |
FO76MI | Mutation Invasion | Mutation Invasion | Mutation Invasion | |
FO76OB | Once in a Blue Moon | Once in a Blue Moon | Once in a Blue Moon | |
FO76AC | Expeditions: Atlantic City | Expeditions: Atlantic City | Expeditions: Atlantic City | |
FOS | Fallout Shelter | Fallout Shelter | Fallout Shelter | |
FOSO | Fallout Shelter Online | Fallout Shelter Online | Fallout Shelter Online | |
FPB | Fallout Pip-Boy | Fallout Pip-Boy | Fallout Pip-Boy | |
FO1 | Fallout | Fallout | Fallout | |
FO2 | Fallout 2 | Fallout 2 | Fallout 2 | |
FO3 | Fallout 3 | Fallout 3 | Fallout 3 | |
FO3BS | Broken Steel | Broken Steel | Broken Steel | |
FO3MZ | Mothership Zeta | Mothership Zeta | Mothership Zeta (add-on) | |
FO3OA | Operation: Anchorage | Operation: Anchorage | Operation: Anchorage (add-on) | |
FO3PL | Point Lookout | Point Lookout | Point Lookout (add-on) | |
FO3TP | The Pitt | The Pitt | The Pitt (add-on) | |
FOBOS | Fallout: Brotherhood of Steel | Fallout: BoS | Fallout: Brotherhood of Steel | |
FOBOS2 | Fallout: Brotherhood of Steel 2 | Fallout: BoS 2 | Fallout: Brotherhood of Steel 2 | |
PV13 | Project V13 | Project V13 | Project V13 | |
FOT | Fallout Tactics | Fallout Tactics | Fallout Tactics: Brotherhood of Steel | |
FOT2 | Fallout Tactics 2 | Fallout Tactics 2 | Fallout Tactics 2 | |
FOTV | Fallout TV series | Fallout (TV series) | Fallout (TV series) | |
FOW | Fallout: Warfare | Fallout: Warfare | Fallout: Warfare | |
FOX | Fallout Extreme | Fallout Extreme | Fallout Extreme | |
FOWW | Fallout: Wasteland Warfare | Fallout: Wasteland Warfare | Fallout: Wasteland Warfare | |
FOWWRPG | Fallout: Wasteland Warfare Roleplaying Game | Fallout: Wasteland Warfare Roleplaying Game | Fallout: Wasteland Warfare Roleplaying Game | |
FORPG | Fallout: The Roleplaying Game | Fallout: The Roleplaying Game | Fallout: The Roleplaying Game | |
FORPGWOA | Winter of Atom | Winter of Atom | Winter of Atom | |
JES | J.E. Sawyer's Fallout RPG | JES Fallout RPG | J.E. Sawyer's Fallout RPG | |
PA | One Man, and a Crate of Puppets | Penny Arcade | One Man, and a Crate of Puppets | |
TAR | The Armageddon Rag | Armageddon Rag | The Armageddon Rag | |
VB | Van Buren | Van Buren | Van Buren | |
Wiki | Nukapedia | Nukapedia | Fallout Wiki:About | |
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'] = "All Roads && All Roads",
['D20'] = "Fallout Pen and Paper d20 && Fallout d20",
['FB'] = "Fallout Bible",
['FBG'] = "Fallout: The Board Game",
['FBGNC'] = "Fallout: New California",
['FBGWW'] = "Fallout: Wasteland Warfare",
['FILM'] = "Fallout (film)",
['FNV'] = "Fallout: New Vegas",
['FNVCS'] = "Courier's Stash",
['FNVDM'] = "Dead Money",
['FNVGRA'] = "Gun Runners' Arsenal",
['FNVHH'] = "Honest Hearts",
['FNVLR'] = "Lonesome Road (add-on) && Lonesome Road",
['FNVOWB'] = "Old World Blues (add-on) && Old World Blues",
['FO4'] = "Fallout 4",
['FO4AUT'] = "Automatron (add-on) && Automatron",
['FO4WW'] = "Wasteland Workshop",
['FO4FH'] = "Far Harbor (add-on) && Far Harbor",
['FO4CW'] = "Contraptions Workshop",
['FO4VW'] = "Vault-Tec Workshop",
['FO4NW'] = "Nuka-World (add-on) && Nuka-World",
['FO4VR'] = "Fallout 4 VR",
['FO4CC'] = "Creation Club",
['FOS'] = "Fallout Shelter",
['FPB'] = "Fallout Pip-Boy",
['FO'] = "Fallout",
['FO1'] = "Fallout",
['FO2'] = "Fallout 2",
['FO3'] = "Fallout 3",
['FO3BS'] = "Broken Steel",
['FO3MZ'] = "Mothership Zeta {add-on) && Mothership Zeta",
['FO3OA'] = "Operation Anchorage (add-on) && Operation Anchorage",
['FO3PL'] = "Point Lookout (add-on) && Point Lookout",
['FO3TP'] = "The Pitt (add-on) && The Pitt",
['FO76'] = "Fallout 76",
['FO76WA'] = "Wild Appalachia",
['FO76NW'] = "Nuclear Winter",
['FO76WL'] = "Wastelanders",
['FOBOS'] = "Fallout: Brotherhood of Steel && Fallout: BoS",
['FOBOS2'] = "Fallout: Brotherhood of Steel 2 && Fallout: BoS 2",
['FOOL'] = "Project V13",
['PV13'] = "Project V13",
['FOT'] = "Fallout Tactics: Brotherhood of Steel && Fallout Tactics",
['FOT2'] = "Fallout Tactics 2",
['FOW'] = "Fallout: Warfare",
['FOX'] = "Fallout Extreme",
['FWW'] = "Fallout: Wasteland Warfare",
['JES'] = "J.E. Sawyer's Fallout RPG && JES Fallout RPG",
['LH'] = "Lionheart",
['PA'] = "One Man, and a Crate of Puppets && Penny Arcade",
['TAR'] = "The Armageddon Rag && Armageddon Rag",
['TORN'] = "TORN",
['VB'] = "Van Buren",
['WIKI'] = "Fallout Wiki:About",
['NONE'] = "Mentioned-only",
['RW'] = "Real world"
}
function abbOnly(abbGames, mode)
local gamesSplit = mw.text.split(abbGames, ",")
local gamesLength = table.getn(gamesSplit)
local gamesCount = 1
local gameOut = ""
while gamesCount <= gamesLength do
local activeGame = gamesSplit[gamesCount]
local gameText = mw.text.split(gameList[activeGame], " && ")
if mode == "link" or mode == "text" or mode == nil then
gameOut = gameOut .. gameText[1] .. " "
else
if gameText[1] ~= nil then
gameOut = gameOut .. gameText[1] .. " "
else
gameOut = gameOut .. gameText[0] .. " "
end
end
gamesCount = gamesCount + 1
end
if gameOut == nil then
gameOut = "Failed"
end
return gameOut
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]))
if mode == "link" or mode == "text" or mode == "short" or mode == nil then
result = abbOnly(games, mode)
end
return result
end
function p.loaded()
result = package.loaded
return result
end
return p