Модуль:Prototypes/Объект/Торгомат: различия между версиями
Pok (обсуждение | вклад) Отмена правки 60243, сделанной Pok (обсуждение) Метка: отмена |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 41: | Строка 41: | ||
if mode == "inventory" and inventory.startingInventory then | if mode == "inventory" and inventory.startingInventory then | ||
for itemId, count in pairs(inventory.startingInventory) do | for itemId, count in pairs(inventory.startingInventory) do | ||
result = result .. mw.getCurrentFrame():preprocess("{{LinkСard|SideStyle=1| | result = result .. mw.getCurrentFrame():preprocess("{{LinkСard|SideStyle=1|background-color=#d7d7ff08|image=" .. itemId .. ".png|name={{#invoke:Entity Lookup|getname|" .. itemId .. "}} [" .. count .. "]}}") | ||
end | end | ||
| Строка 47: | Строка 47: | ||
elseif mode == "contraband" and inventory.contrabandInventory then | elseif mode == "contraband" and inventory.contrabandInventory then | ||
for itemId, count in pairs(inventory.contrabandInventory) do | for itemId, count in pairs(inventory.contrabandInventory) do | ||
result = result .. mw.getCurrentFrame():preprocess("{{LinkСard|SideStyle=1| | result = result .. mw.getCurrentFrame():preprocess("{{LinkСard|SideStyle=1|background-color=#d7d7ff08|image=" .. itemId .. ".png|name={{#invoke:Entity Lookup|getname|" .. itemId .. "}} [" .. count .. "]}}") | ||
end | end | ||
| Строка 53: | Строка 53: | ||
elseif mode == "emag" and inventory.emaggedInventory then | elseif mode == "emag" and inventory.emaggedInventory then | ||
for itemId, count in pairs(inventory.emaggedInventory) do | for itemId, count in pairs(inventory.emaggedInventory) do | ||
result = result .. mw.getCurrentFrame():preprocess("{{LinkСard|SideStyle=1| | result = result .. mw.getCurrentFrame():preprocess("{{LinkСard|SideStyle=1|background-color=#d7d7ff08|image=" .. itemId .. ".png|name={{#invoke:Entity Lookup|getname|" .. itemId .. "}} [" .. count .. "]}}") | ||
end | end | ||
end | end | ||
| Строка 75: | Строка 75: | ||
for _, restock in ipairs(restockData) do | for _, restock in ipairs(restockData) do | ||
if restock.canRestock and table.concat(restock.canRestock):find(packId) then | if restock.canRestock and table.concat(restock.canRestock):find(packId) then | ||
return mw.getCurrentFrame():preprocess("{{LinkСard| | return mw.getCurrentFrame():preprocess("{{LinkСard|background-color=#d7d7ff08|image=" .. restock.id .. "|name={{#invoke:Entity Lookup|getname|" .. restock.id .. "}}|link=Торговые автоматы#{{#invoke:Entity Lookup|getname|" .. restock.id .. "}}}}") | ||
end | end | ||
end | end | ||