Модуль:Entity Lookup: различия между версиями
Mhamster (обсуждение | вклад) м Отмена правки 18233, сделанной Mhamster (обсуждение) Метка: отмена |
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] | ||
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=]]"}} | |||
return out | return out | ||
end | end | ||