Модуль:Entity Lookup: различия между версиями
Mhamster (обсуждение | вклад) preprocess |
Mhamster (обсуждение | вклад) clear comments |
||
| Строка 5: | Строка 5: | ||
-- p | -- p.getname{args={"FreedomImplant"}} | ||
function p.getname(frame, entid) -- {{#invoke:Entity Lookup|getname|ProtoID}} | function p.getname(frame, entid) -- {{#invoke:Entity Lookup|getname|ProtoID}} | ||
local out = "" | local out = "" | ||
| Строка 21: | Строка 21: | ||
-- p | -- p.getname{args={"FreedomImplant"}} | ||
function p.getdesc(frame, entid) -- {{#invoke:Entity Lookup|getdesc|ProtoID}} | function p.getdesc(frame, entid) -- {{#invoke:Entity Lookup|getdesc|ProtoID}} | ||
local out = "" | local out = "" | ||
| Строка 41: | Строка 41: | ||
local out = " " | local out = " " | ||
local entity = p.entities[frame.args[2]] | local entity = p.entities[frame.args[2]] | ||
local stats = frame:preprocess("{{Особое|".. 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:preprocess("{{Tooltip|".. 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:preprocess("{{Tooltip|".. 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:preprocess("{{Tooltip|".. frame.args[1] .."|Не найден|Предмет не найден|".. frame.args["img"] .."}}") | out = frame:preprocess("{{Tooltip|".. frame.args[1] .."|Не найден|Предмет не найден|".. frame.args["img"] .."}}") | ||
end | end | ||
| Строка 66: | Строка 62: | ||
local pic = frame.args[1] | local pic = frame.args[1] | ||
local meta = frame.args["Мета"] | local meta = frame.args["Мета"] | ||
local stats = frame:preprocess("{{Особое|".. frame.args[2] .."}}") | local stats = frame:preprocess("{{Особое|".. frame.args[2] .."}}") | ||
if meta == nil then | if meta == nil then | ||
| Строка 75: | Строка 70: | ||
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:preprocess("{{Tooltip|".. pic .. "|" .. entity.name .. "|" .. entity.desc .. "|" .. stats .."}}") | out = frame:preprocess("{{Tooltip|".. pic .. "|" .. entity.name .. "|" .. entity.desc .. "|" .. stats .."}}") | ||
end else | end else | ||
out = frame:preprocess("{{Tooltip|[[Файл: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:preprocess("{{Tooltip|" .. pic .. "|Не найден|Предмет не найден|img=Mousegif.gif}}") | out = frame:preprocess("{{Tooltip|" .. pic .. "|Не найден|Предмет не найден|img=Mousegif.gif}}") | ||
end | end | ||