trusted
167
edits
(Add logic to parse GameData/protosets.json) |
(Add direct methods to use directly without a template) |
||
Line 15: | Line 15: | ||
function funcs.recipesMaking(frame) | function funcs.recipesMaking(frame) | ||
name = frame:getParent().args[1] | name = frame:getParent().args[1] | ||
item = itemByName(name) | |||
recipes = recipesMakingByID(item.ID) | |||
return tableRecipes(recipes, frame) | |||
end | |||
function funcs.recipesMakingDirect(frame) | |||
name = frame.args[1] | |||
item = itemByName(name) | item = itemByName(name) | ||
recipes = recipesMakingByID(item.ID) | recipes = recipesMakingByID(item.ID) | ||
Line 23: | Line 30: | ||
output = {} | output = {} | ||
name = frame:getParent().args[1] | name = frame:getParent().args[1] | ||
item = itemByName(name) | |||
components, buildings = recipesUsingByID(item.ID) | |||
if next(components) then | |||
table.insert(output, '=== Components ===') | |||
table.insert(output, tableRecipes(components, frame)) | |||
end | |||
if next(buildings) then | |||
table.insert(output, '=== Buildings ===') | |||
table.insert(output, tableRecipes(buildings, frame)) | |||
end | |||
return table.concat(output, '\n') | |||
end | |||
function funcs.recipesUsingDirect(frame) | |||
output = {} | |||
name = frame.args[1] | |||
item = itemByName(name) | item = itemByName(name) | ||
components, buildings = recipesUsingByID(item.ID) | components, buildings = recipesUsingByID(item.ID) |