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

Нет описания правки
Метка: ручная отмена
preprocess
Строка 41: Строка 41:
     local out = " "
     local out = " "
     local entity = p.entities[frame.args[2]]
     local entity = p.entities[frame.args[2]]
     local stats = frame:expandTemplate{ title = "Особое", args = { frame.args[2] }}
     -- local stats = frame:expandTemplate{ title = "Особое", args = { frame.args[2] }}
    local stats = frame:preprocess("{{Особое|".. frame.args[2] .."}}")
     if entity ~= nil then do
     if entity ~= nil then do
     if frame.args["img"] ~= nil then do
     if frame.args["img"] ~= nil then do
     out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1], entity.name, entity.desc, stats, img=frame.args["img"] }}
     -- out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1], entity.name, entity.desc, stats, img=frame.args["img"] }}
    out = frame:preprocess("{{Tooltip|".. frame.args[1] .."|".. entity.name .."|".. entity.desc .."|".. stats .."|img=".. frame.args["img"] .."}}")
     end else
     end else
     out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1],  entity.name, entity.desc, stats }}
     -- out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1],  entity.name, entity.desc, stats }}
    out = frame:preprocess("{{Tooltip|".. frame.args[1] .."|".. entity.name .."|".. entity.desc .."|".. stats .."}}")
     end
     end
     -- {{Tooltip|Текст|[[картиночка|64x64px|left|middle|link=]] Название|Описание}}
     -- {{Tooltip|Текст|[[картиночка|64x64px|left|middle|link=]] Название|Описание}}
     end else
     end else
      out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1],  "Не найден", "Предмет не найден", img=frame.args[3]}}
    --    out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1],  "Не найден", "Предмет не найден", img=frame.args[3]}}
      out = frame:preprocess("{{Tooltip|".. frame.args[1] .."|Не найден|Предмет не найден|".. frame.args["img"] .."}}")
     end
     end
     return out
     return out
Строка 62: Строка 66:
     local pic = frame.args[1]
     local pic = frame.args[1]
     local meta = frame.args["Мета"]
     local meta = frame.args["Мета"]
     local stats = frame:expandTemplate{ title = "Особое", args = { frame.args[2] }}
     -- local stats = frame:expandTemplate{ title = "Особое", args = { frame.args[2] }}
    local stats = frame:preprocess("{{Особое|".. frame.args[2] .."}}")
     if meta == nil then
     if meta == nil then
         meta = "64x64px|link="
         meta = "64x64px|link="
Строка 70: Строка 75:
     if entity ~= nil then do
     if entity ~= nil then do
     if frame.args[1] ~= nil then do
     if frame.args[1] ~= nil then do
     out = frame:expandTemplate{ title = "Tooltip", args = { pic, entity.name, entity.desc, stats }}
     -- out = frame:expandTemplate{ title = "Tooltip", args = { pic, entity.name, entity.desc, stats }}
    out = frame:preprocess("{{Tooltip|".. pic .. "|" .. entity.name .. "|" .. entity.desc .. "|" .. stats .."}}")
     end else
     end else
     out = frame:expandTemplate{ title = "Tooltip", args = { "[[Файл:Mousegif.gif|64x64px|left|middle|link=]]",  entity.name, entity.desc, stats }}
     -- out = frame:expandTemplate{ title = "Tooltip", args = { "[[Файл:Mousegif.gif|64x64px|left|middle|link=]]",  entity.name, entity.desc, stats }}
    out = frame:preprocess("{{Tooltip|[[Файл:Mousegif.gif|64x64px|left|middle|link=]]|" .. entity.name .. "|" .. entity.desc .. "|" .. stats .."}}")
     end
     end
     -- {{Tooltip|Текст|[[картиночка|64x64px|left|middle|link=]] Название|Описание}}
     -- {{Tooltip|Текст|[[картиночка|64x64px|left|middle|link=]] Название|Описание}}
     end else
     end else
      out = frame:expandTemplate{ title = "Tooltip", args = { pic,  "Не найден", "Предмет не найден", img="Mousegif.gif"}}
    --    out = frame:expandTemplate{ title = "Tooltip", args = { pic,  "Не найден", "Предмет не найден", img="Mousegif.gif"}}
      out = frame:preprocess("{{Tooltip|" .. pic .. "|Не найден|Предмет не найден|img=Mousegif.gif}}")
     end
     end
     return out
     return out