Модуль:Meals Lookup: различия между версиями

toolmaderecipes images
heatable names fix + comments fix
Строка 190: Строка 190:
--#region grindableRecipes
--#region grindableRecipes


function p.buildgrindrecipebox(frame) -- {{#invoke:Meals Lookup|buildgrindrecipebox|SliceableRecipeID}}
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|SliceableRecipeID}}
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["id"] .. "}}" ..
         "|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|SliceableRecipeID}}
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["id"] .. "}}" ..
         "|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|SliceableRecipeID}}
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 = ""
    -- out = out .. p.buildmicrowaverecipes(frame)
    -- out = out .. p.buildslicerecipes(frame)
    -- out = out .. p.buildgrindrecipes(frame)
    -- out = out .. p.buildheatrecipes(frame)
    -- out = out .. p.buildtoolmaderecipes(frame)
    -- out = out .. p.buildixablerecipes(frame)
    -- out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildmicrowaverecipebox|" .. frame.args[1] .. "}}")
    -- out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildslicerecipebox|" .. frame.args[2] .. "}}")
    -- out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildgrindrecipebox|" .. frame.args[3] .. "}}")
    -- out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildheatrecipebox|" .. frame.args[4] .. "}}")
    -- out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildtoolmaderecipebox|" .. frame.args[5] .. "}}")
    -- out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildmixablerecipebox|" .. frame.args[6] .. "}}")
     return out
     return out
end
end


return p
return p