Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Module:Icon: Difference between revisions

From The Petit Planet Wiki
No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 157: Line 157:
setmetatable(out, {
setmetatable(out, {
__index = function(t, key)
__index = function(t, key)
local val = base[key]
-- be defensive: base or extra may be nil
if val ~= nil then return val else return extra[key] end
local val
if base ~= nil then
val = base[key]
end
if val ~= nil then
return val
end
if extra ~= nil then
return extra[key]
end
return nil
end
end
})
})
return out
return out
end
end
local neighbors = mw.loadData('Module:Card/neighbors')
local neighbors = mw.loadData('Module:Card/neighbors')
local ALL_DATA = {-- list of {type, data} in the order that untyped items should get checked
local ALL_DATA = {-- list of {type, data} in the order that untyped items should get checked
Line 359: Line 370:
local image = createImage(args)
local image = createImage(args)
image.prefix = image_type
image.suffix = 'Icon'
image.suffix = 'Icon'
      
image.defaults.suffix = 'Icon'
     return image, image_type, data
end
end


return p
return p