(En tableaux ?) |
(Args !) |
||
(15 versions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
+ | local p = {} |
||
− | -- ["iconName"] = { n="fileName", e="extension", w=fileWidth, h=fileHeight, d="textToDisplay", l="pageLink" }, |
||
+ | local rtext = require( 'Module:Text' ) |
||
+ | p.wikiName = { |
||
⚫ | |||
+ | -- ["simplified_name"] = "name_to_use_in_the_wiki", |
||
− | ["attack fly"] = { { n="Attack Fly", e="png", w=19, h=10, d="Attack Fly", l="Attack Fly" }, |
||
+ | item = { |
||
− | app = { n="Attack Fly", e="jpg", w=19, h=15, d="Attack Fly", l="Attack Fly" }, |
||
+ | }, |
||
− | anim = { n="Attack Fly", e="gif", w=19, h=15, d="Attack Fly", l="Attack Fly" }, }, |
||
+ | monster = { |
||
− | ["gaper"] = { n="Gaper", e="png", w=28, h=33, d="Gaper", l="Gaper" }, |
||
+ | }, |
||
+ | trinket = { |
||
+ | } |
||
} |
} |
||
+ | |||
+ | |||
+ | p.displayName = { |
||
+ | -- ["name_used_in_the_wiki"] = "name_to_display", |
||
+ | item = { |
||
+ | }, |
||
+ | monster = { |
||
+ | }, |
||
+ | trinket = { |
||
+ | } |
||
+ | } |
||
+ | |||
+ | |||
+ | p.imageSize = { |
||
+ | -- ["icon_name"] = { { file_width, file_weight }, |
||
+ | -- another_image = { file_width, file_weight }, |
||
+ | -- another_image = { file_width, file_weight }, } |
||
+ | item = { |
||
+ | }, |
||
+ | monster = { |
||
+ | ["attack fly"] = { { 19, 10 }, |
||
+ | anim = { 19, 15 }, }, |
||
+ | ["gaper"] = { { 28, 33 }, }, |
||
+ | }, |
||
+ | trinket = { |
||
+ | } |
||
+ | } |
||
+ | |||
+ | |||
+ | function p.searchData( f ) |
||
+ | local args = rtext.trimAll( rtext.getArgs( f ) ) |
||
+ | if args.typeTable then |
||
+ | if p[args.mainTable][args.typeTable] then |
||
+ | for i, j in pairs( p[args.mainTable][args.typeTable] ) do |
||
+ | if args.value == i then |
||
+ | return j |
||
+ | end |
||
+ | end |
||
+ | end |
||
+ | end |
||
+ | |||
+ | for k, l in pairs( p[args.mainTable] ) do |
||
+ | for m, n in pairs( p[args.mainTable][k] ) do |
||
+ | if args.value == m then |
||
+ | return n |
||
+ | end |
||
+ | end |
||
+ | end |
||
+ | end |
||
+ | |||
⚫ |
Dernière version du 31 octobre 2017 à 07:56
La documentation pour ce module peut être créée à Module:Data/doc
local p = {}
local rtext = require( 'Module:Text' )
p.wikiName = {
-- ["simplified_name"] = "name_to_use_in_the_wiki",
item = {
},
monster = {
},
trinket = {
}
}
p.displayName = {
-- ["name_used_in_the_wiki"] = "name_to_display",
item = {
},
monster = {
},
trinket = {
}
}
p.imageSize = {
-- ["icon_name"] = { { file_width, file_weight },
-- another_image = { file_width, file_weight },
-- another_image = { file_width, file_weight }, }
item = {
},
monster = {
["attack fly"] = { { 19, 10 },
anim = { 19, 15 }, },
["gaper"] = { { 28, 33 }, },
},
trinket = {
}
}
function p.searchData( f )
local args = rtext.trimAll( rtext.getArgs( f ) )
if args.typeTable then
if p[args.mainTable][args.typeTable] then
for i, j in pairs( p[args.mainTable][args.typeTable] ) do
if args.value == i then
return j
end
end
end
end
for k, l in pairs( p[args.mainTable] ) do
for m, n in pairs( p[args.mainTable][k] ) do
if args.value == m then
return n
end
end
end
end
return p