Module:Crafting: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
p = {} | p = {} | ||
function Grid(args, w, h) | function Grid(args, w, h, large) | ||
return require([[Module:InventorySlot]]).Call(args,w,h) | return require([[Module:InventorySlot]]).Call(args,w,h,large) | ||
end | end | ||
Line 21: | Line 21: | ||
return Grid(args, 1, 1) | return Grid(args, 1, 1) | ||
end | |||
function p.BigCell( f ) | |||
local args = f.args | |||
if #args == 0 then | |||
args = f:getParent().args | |||
end | |||
return Grid(args, 1, 1, true) | |||
end | end | ||
Revision as of 16:12, 10 November 2018
Implements {{Template:Crafting}}
Dependency
See Also
- Template:Crafting
- Template:CraftingCatalyst
- Template:CraftingCell
- Template:CraftingGrid
- Template:CraftingHopper
p = {}
function Grid(args, w, h, large)
return require([[Module:InventorySlot]]).Call(args,w,h,large)
end
function p.Grid( f )
local args = f.args
if #args == 0 then
args = f:getParent().args
end
return Grid(args, 3, 3)
end
function p.Cell( f )
local args = f.args
if #args == 0 then
args = f:getParent().args
end
return Grid(args, 1, 1)
end
function p.BigCell( f )
local args = f.args
if #args == 0 then
args = f:getParent().args
end
return Grid(args, 1, 1, true)
end
function p.Hopper( f )
local args = f.args
if #args == 0 then
args = f:getParent().args
end
return Grid(args, 5, 1)
end
function p.Catalyst( f )
local args = f.args
if #args == 0 then
args = f:getParent().args or {""}
end
return require([[Module:Sprite]])
:new("inventory")
:setItem(mw.text.trim(args[1]))
:GenerateHTML()
end
return p