Модуль:Entity Lookup: различия между версиями
Mhamster (обсуждение | вклад) createtooltip => createtexttooltip, createimagetooltip => createimagetooltip |
Mhamster (обсуждение | вклад) getname, getdesc |
||
| Строка 3: | Строка 3: | ||
local p = {} | local p = {} | ||
p.entities = prototypes.entities | p.entities = prototypes.entities | ||
-- p,getname{args={"FreedomImplant"}} | |||
function p.getname(frame) -- {{#invoke:Entity Lookup|getname|ProtoID}} | |||
local out = "" | |||
local entity = p.entities[frame.args[1]] | |||
if entity ~= nil then | |||
out = entity.name | |||
else | |||
out = "Не найдено" | |||
end | |||
return out | |||
end | |||
-- p,getname{args={"FreedomImplant"}} | |||
function p.getdesc(frame) -- {{#invoke:Entity Lookup|getdesc|ProtoID}} | |||
local out = "" | |||
local entity = p.entities[frame.args[1]] | |||
if entity ~= nil then | |||
out = entity.desc | |||
else | |||
out = "Не найдено" | |||
end | |||
return out | |||
end | |||
| Строка 47: | Строка 73: | ||
return out | return out | ||
end | end | ||
return p | return p | ||