La documentation pour ce module peut être créée à Module:Abr/doc
local p = {}
local gameList = {
AR = {
icone = "Gametitre-AR.png",
titre = "All Roads",
court = "All Roads"
},
D20 = {
icone = "Gametitre-D20.png",
titre = "Fallout Pen and Paper d20",
lien = "Fallout d20",
court = "Fallout d20"
},
FB = {
icone = "Gametitre-FB.png",
titre = "Fallout Bible"
},
FBG = {
icone = "Gametitre-FBG.png",
titre = "Fallout: The Board Game"
},
FBGNC = {
icone = "Gametitre-FBGNC.png",
titre = "Fallout: New California"
},
FBGWW = {
icone = "Gametitre-FBGWW.png",
titre = "Fallout: Wasteland Warfare",
},
FILM = {
icone = "Film.png",
titre = "Fallout (film)"
},
FNV = {
icone = "Gametitre-FNV.png",
titre = "Fallout: New Vegas"
},
FNVCS = {
icone = "Gametitre-FNV_CS.png",
titre = "Courier's Stash"
},
FNVDM = {
icone = "Gametitre-FNV_DM.png",
titre = "Dead Money"
},
FNVGRA = {
icone = "Gametitre-FNV_GRA.png",
titre = "Gunn Runners' Arsenal"
},
FNVHH = {
icone = "Gametitre-FNV_HH.png",
titre = "Honest Hearts"
},
FNVLR = {
icone = "Gametitre-FNV_LR.png",
titre = "Lonesome Road (add-on)",
lien = "Lonesome Road",
court = "Lonesome Road"
},
FNVOWB = {
icone = "Gametitre-FNV_OWB.png",
titre = "Old World Blues (add-on)",
lien = "Old World Blues",
court = "Old World Blues"
},
FO4 = {
icone = "Gametitre-FO4.png",
titre = "Fallout 4",
},
FO4AUT = {
icone = "Gametitre-FO4_AUT.png",
titre = "Automatron (add-on)",
lien = "Automatron",
court = "Automatron"
},
FO4WW = {
icone = "Gametitre-FO4_WW.png",
titre = "Wasteland Workshop"
},
FO4FH = {
icone = "Gametitre-FO4_FH.png",
titre = "Far Harbor (add-on)",
lien = "Far Harbor",
court = "Far Harbor"
},
FO4CW = {
icone = "Gametitre-FO4_CW.png",
titre = "Contraptions Workshop"
},
FO4VW = {
icone = "Gametitre-FO4_VW.png",
titre = "Vault-Tec Workshop"
},
FO4NW = {
icone = "Gametitre-FO4_NW.png",
titre = "Nuka-World (add-on)",
lien = "Nuka-World",
court = "Nuka-World"
},
FO4VR = {
icone = "Gametitre-FO4VR.png",
titre = "Fallout 4 VR"
},
FO4CC = {
icone = "Gametitre-FO4_CC.png",
titre = "Creation Club"
},
FOS = {
icone = "Gametitre-FOS.png",
titre = "Fallout Shelter",
},
FPB = {
icone = "Gametitre-FPB.png",
titre = "Fallout Pip-Boy"
},
FO = {
icone = "Gametitre-FO1.png",
titre = "Fallout"
},
FO1 = {
icone = "Gametitre-FO1.png",
titre = "Fallout"
},
FO2 = {
icone = "Gametitre-FO2.png",
titre = "Fallout 2"
},
FO3 = {
icone = "Gametitre-FO3.png",
titre = "Fallout 3"
},
FO3BS = {
icone = "Gametitre-FO3_BS.png",
titre = "Broken Steel"
},
FO3MZ = {
icone = "Gametitre-FO3_MZ.png",
titre = "Mothership Zeta (add-on)",
lien = "Mothership Zeta",
court = "Mothership Zeta"
},
FO3OA = {
icone = "Gametitre-FO3_OA.png",
titre = "Operation: Anchorage (add-on)",
lien = "Operation: Anchorage",
court = "Operation: Anchorage"
},
FO3PL = {
icone = "Gametitre-FO3_PL.png",
titre = "Point Lookout (add-on)",
lien = "Point Lookout",
court = "Point Lookout"
},
FO3TP = {
icone = "Gametitre-FO3_TP.png",
titre = "The Pitt (add-on)",
lien = "The Pitt",
court = "The Pitt"
},
FO76 = {
icone = "Gametitre-FO76.png",
titre = "Fallout 76"
},
FO76WA = {
icone = "Gametitre-FO76_WA.png",
titre = "Wild Appalachia"
},
FO76NW = {
icone = "Gametitre-FO76_NW.png",
titre = "Nuclear Winter"
},
FO76WL = {
icone = "Gametitre-FO76_WL.png",
titre = "Wastelanders"
},
FOBOS = {
icone = "Gametitre-FOBOS.png",
titre = "Fallout: Brotherhood of Steel",
lien = "Fallout: Brotherhood of Steel",
court = "Fallout: BoS"
},
FOBOS2 = {
icone = "Gametitre-FOBOS2.png",
titre = "Fallout: Brotherhood of Steel 2",
lien = "Fallout: Brotherhood of Steel 2",
court = "Fallout: BoS 2"
},
FOOL = {
icone = "PV13.png",
titre = "Project V13"
},
PV13 = {
icone = "PV13.png",
titre = "Project V13"
},
FOT = {
icone = "Gametitre-FOT.png",
titre = "Fallout Tactics: Brotherhood of Steel",
lien = "Fallout Tactics",
court = "Fallout Tactics"
},
FOT2 = {
icone = "Gametitre-FOT2.png",
titre = "Fallout Tactics 2"
},
FOW = {
icone = "Gametitre-FOW.png",
titre = "Fallout: Warfare"
},
FOX = {
icone = "Gametitre-FOX.png",
titre = "Fallout Extreme"
},
FWW = {
icone = "Gametitre-FWW.png",
titre = "Fallout: Wasteland Warfare"
},
JES = {
icone = "Gametitre-JES.png",
titre = "J.E. Sawyer's Fallout RPG",
court = "JES Fallout RPG"
},
LH = {
icone = "Gametitre-LH.png",
titre = "Lionheart"
},
PA = {
icone = "Penny Arcade.gif",
titre = "One Man, and a Crate of Puppets",
court = "Penny Arcade"
},
TAR = {
icone = "Gametitre-TAR.jpg",
titre = "The Armageddon Rag",
court = "Armageddon Rag"
},
TORN = {
icone = "Gametitre-TORN.png",
titre = "TORN"
},
VB = {
icone = "Gametitre-VB.png",
titre = "Van Buren"
},
WIKI = {
icone = "Gametitre-Wiki.png",
titre = "Fallout Wiki:About",
court = "Nukapedia"
},
NONE = {
titre = "mentioned-only"
},
RW = {
titre = "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['jeux'])
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 icone(frame)
local fileCount = 1
local fileOut = ""
while fileCount <= abrLength do
currentFile = string.upper(abrGames[fileCount])
currentFile = abricone[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['jeux'])
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]['lien'] ~= nil then
currentCat = gameList[currentCat]['lien']
else
currentCat = gameList[currentCat]['titre']
end
result = result .. "[[Catégorie:"
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 = "[[Catégorie:" .. category
if sortKey ~= nil and string.len(sortKey) ~= 0 then
result = result .. "|" .. sortKey
end
result = result .. "]]"
end
return result
end
function p.abr(frame)
if frame.args[2] ~= nil then
mode = string.lower(frame.args[2])
end
local jeux = string.upper(tostring(frame.args[1]))
jeux = mw.text.split(jeux, ",")
longueur = table.getn(jeux)
if mode == "lien" or mode == "texte" or mode == "court" or mode == nil then
result = abrOnly(jeux, mode, longueur)
end
if mode == "cat" then
abrCatName = frame.args[3]
abrAppend = frame.args[4]
abrPrepend = frame.args[5]
abrCatMode = frame.args[6]
abrSort = frame.args[7]
result = abrCategory(jeux, longueur, abrCatName, abrAppend, abrPrepend, abrCatMode, abrSort)
end
if mode == "icône" then
result = abrFile(jeux, longueur)
end
return result
end
return p
Sauf mention contraire, le contenu de la communauté est disponible sous licence CC-BY-SA .