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

м Отмена правки 18233, сделанной Mhamster (обсуждение)
Метка: отмена
мНет описания правки
Строка 4: Строка 4:
p.entities = prototypes.entities
p.entities = prototypes.entities


-- p.createtooltip{args={"Верхний текст", "FreedomImplant", "Файл:Honks.gif"}}
function p.createtooltip(frame) -- {{#invoke:Entity Lookup|createtooltip|Текст|ProtoID|картиночка}}
function p.createtooltip(frame) -- {{#invoke:Entity Lookup|createtooltip|Текст|ProtoID|картиночка}}
     local out = ""
     local out = " "
     local entity = p.entities[frame.args[3]]
    local text = frame.args[1]
     if entity ~= nil then do
     local entity = p.entities[frame.args[2]]
    local pic = frame.args[3]
     print(text)
print(entity)
    print(pic)
     -- {{Tooltip|Текст|Название|Описание|[[картиночка|64x64px|left|middle|link=]]}}
     -- {{Tooltip|Текст|Название|Описание|[[картиночка|64x64px|left|middle|link=]]}}
        out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1],  entity.name, entity.desc, "[[" .. frame.args[3] .. "|64x64px|left|middle|link=]]"}}
    out = frame:expandTemplate{ title = "Tooltip", args = { frame.args[1],  entity.name, entity.desc, "[[" .. frame.args[3] .. "|64x64px|left|middle|link=]]"}}
    end else
      out =  frame:expandTemplate{ title = "Tooltip", args = { frame.args[1],  "Не найден", "Предмет не найден", "[[Файл:Mousegif.gif|64x64px|left|middle|link=]]"}}
    end
     return out
     return out
end
end