Модуль:Meals Lookup: различия между версиями
Mhamster (обсуждение | вклад) toolmaderecipes images |
Mhamster (обсуждение | вклад) heatable names fix + comments fix |
||
| Строка 190: | Строка 190: | ||
--#region grindableRecipes | --#region grindableRecipes | ||
function p.buildgrindrecipebox(frame) -- {{#invoke:Meals Lookup|buildgrindrecipebox| | function p.buildgrindrecipebox(frame) -- {{#invoke:Meals Lookup|buildgrindrecipebox|GrindableRecipeID}} | ||
local out = "" | local out = "" | ||
local id = frame.args[1]:gsub(' ', '') | local id = frame.args[1]:gsub(' ', '') | ||
| Строка 218: | Строка 218: | ||
--#region heatableRecipes | --#region heatableRecipes | ||
function p.buildheatrecipebox(frame) -- {{#invoke:Meals Lookup|buildheatrecipebox| | function p.buildheatrecipebox(frame) -- {{#invoke:Meals Lookup|buildheatrecipebox|HeatableRecipeID}} | ||
local out = "" | local out = "" | ||
local id = frame.args[1]:gsub(' ', '') | local id = frame.args[1]:gsub(' ', '') | ||
local recipe = getrecipe(frame, "heatableRecipes", id) | local recipe = getrecipe(frame, "heatableRecipes", id) | ||
out = frame:preprocess("{{Recipe Box" .. | out = frame:preprocess("{{Recipe Box" .. | ||
"|name={{#invoke:Entity Lookup|getname|" .. recipe[" | "|name={{#invoke:Entity Lookup|getname|" .. recipe["result"] .. "}}" .. | ||
"|component-1=" .. | "|component-1=" .. | ||
frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|" .. | frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|" .. | ||
| Строка 247: | Строка 247: | ||
--#region toolmadeRecipes | --#region toolmadeRecipes | ||
function p.buildtoolmaderecipebox(frame) -- {{#invoke:Meals Lookup|buildtoolmaderecipebox| | function p.buildtoolmaderecipebox(frame) -- {{#invoke:Meals Lookup|buildtoolmaderecipebox|ToolmadeRecipeID}} | ||
local out = "" | local out = "" | ||
local id = frame.args[1]:gsub(' ', '') | local id = frame.args[1]:gsub(' ', '') | ||
| Строка 253: | Строка 253: | ||
local transformer = "toolmadeRecipes" .. recipe["tool"] | local transformer = "toolmadeRecipes" .. recipe["tool"] | ||
out = frame:preprocess("{{Recipe Box" .. | out = frame:preprocess("{{Recipe Box" .. | ||
"|name={{#invoke:Entity Lookup|getname|" .. recipe[" | "|name={{#invoke:Entity Lookup|getname|" .. recipe["result"] .. "}}" .. | ||
"|component-1=" .. | "|component-1=" .. | ||
frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|" .. | frame:preprocess("{{Recipe Component|item={{#invoke:Entity Lookup|getname|" .. | ||
| Строка 277: | Строка 277: | ||
--#region mixableRecipes | --#region mixableRecipes | ||
function getchemicalreagents(recipe) | function getchemicalreagents(recipe) -- should not be invoked | ||
local out = {} | local out = {} | ||
for ingredient, data in pairs(recipe["reactants"]) do | for ingredient, data in pairs(recipe["reactants"]) do | ||
| Строка 285: | Строка 285: | ||
end | end | ||
function p.buildmixablerecipebox(frame) -- {{#invoke:Meals Lookup|buildmixablerecipebox| | function p.buildmixablerecipebox(frame) -- {{#invoke:Meals Lookup|buildmixablerecipebox|MixableRecipeID}} | ||
local out = "" | local out = "" | ||
local id = frame.args[1]:gsub(' ', '') | local id = frame.args[1]:gsub(' ', '') | ||
| Строка 316: | Строка 316: | ||
function p.tests(frame) | function p.tests(frame) | ||
local out = "" | local out = "" | ||
return out | return out | ||
end | end | ||
return p | return p | ||