Module:Icon: Difference between revisions
From The Petit Planet Wiki
More actions
ReisuDesign (talk | contribs) No edit summary |
ReisuDesign (talk | contribs) 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 | 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.suffix = 'Icon' | image.suffix = 'Icon' | ||
image.defaults.suffix = 'Icon' | |||
return image, image_type, data | |||
end | end | ||
return p | return p | ||