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

Нет описания правки
Нет описания правки
Строка 11: Строка 11:


function p.getrecipe(frame, type, id)
function p.getrecipe(frame, type, id)
     return p.getrecipesfromtype(frame, type)[id]
     return p.getrecipesfromtype(frame, type)[id:gsub(' ', '')]
end
end


Строка 49: Строка 49:
end
end


function p.buildmicrowaverecipebox(frame, recipeId)
function p.buildmicrowaverecipebox(frame)
     local out = "hehe"
     local out = "hehe"
     local id = ""
     local id = frame.args[1]:gsub(' ', '')
    if frame.args["id"] ~= nil then id = frame.args["id"]
    else id = recipeId end
     local recipe = p.getrecipe(frame, "microwaveRecipes", id)
     local recipe = p.getrecipe(frame, "microwaveRecipes", id)
     local solids = p.buildsolids(frame, p.getmicrowaverecipesolids(frame, recipe))
     local solids = p.buildsolids(frame, p.getmicrowaverecipesolids(frame, recipe))
Строка 90: Строка 88:
     out = out .. p.buildsolids(frame, p.getmicrowaverecipesolids(frame, p.getrecipe(frame, frame.args[2], frame.args[1])))
     out = out .. p.buildsolids(frame, p.getmicrowaverecipesolids(frame, p.getrecipe(frame, frame.args[2], frame.args[1])))
     out = out .. "\n" .. p.buildreagents(frame, p.getmicrowaverecipereagents(frame, p.getrecipe(frame, frame.args[2], frame.args[1])))
     out = out .. "\n" .. p.buildreagents(frame, p.getmicrowaverecipereagents(frame, p.getrecipe(frame, frame.args[2], frame.args[1])))
     out = out .. "\n" .. p.buildmicrowaverecipebox(frame, frame.args[1])
     out = out .. "\n" .. frame:preprocess("{{#invoke:Meals Lookup|buildmicrowaverecipebox|".. frame.args[1] .. "}}")
     -- out = out .. p.buildmicrowaverecipebox(frame, frame.args[1])
     -- out = out .. p.buildmicrowaverecipebox(frame, frame.args[1])
     return out
     return out