Модуль:Prototypes/Хранилище/Предмет: различия между версиями

мНет описания правки
Нет описания правки
Строка 68: Строка 68:
     end
     end


    -- Если передан объект с id
     local id = content.id or content
     local id = content.id or content
     local name = string.format('{{#invoke:Entity Lookup|getname|%s}}', id)
     local name = string.format('{{#invoke:Entity Lookup|getname|%s}}', id)
     local image = string.format('%s.png', id)
     local image = string.format('%s.png', id)
     local amount = (content.amount and content.amount ~= 1) and string.format(" [%d]", content.amount) or ""
   
     local amountNumber = 1
    if content.amount then
        if type(content.amount) == "table" then
            amountNumber = content.amount.value or 1
        else
            amountNumber = content.amount
        end
    end
    local amount = (amountNumber and amountNumber ~= 1) and string.format(" [%d]", amountNumber) or ""
   
     local prob = ""
     local prob = ""