Binding of Isaac: Rebirth Wiki
S'inscrire
(Utilisation sur pages HTML)
(Args !)
 
Ligne 1 : Ligne 1 :
 
local p = {}
 
local p = {}
  +
local rtext = require( 'Module:Text' )
   
 
p.wikiName = {
 
p.wikiName = {
Ligne 40 : Ligne 41 :
   
 
function p.searchData( f )
 
function p.searchData( f )
local args = p.trimAll( p.getArgs( f ) )
+
local args = rtext.trimAll( rtext.getArgs( f ) )
 
if args.typeTable then
 
if args.typeTable then
 
if p[args.mainTable][args.typeTable] then
 
if p[args.mainTable][args.typeTable] then

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