Модуль:Prototypes/Хранилище/Предмет: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 33: | Строка 33: | ||
local prob = "" | local prob = "" | ||
-- Если есть weight, преобразуем его в prob | |||
if content.weight then | |||
content.prob = content.weight / 100 | |||
end | |||
-- Если есть prob, формируем отображение процента | |||
if content.prob then | if content.prob then | ||
local percentage = content.prob * 100 | local percentage = content.prob * 100 | ||
| Строка 42: | Строка 48: | ||
end | end | ||
return string.format('{{LinkСard|SideStyle=1|background-color=#d7d7ff0b|image=%s|name=%s%s%s {{#invoke:Prototypes/Хранилище/Предмет|main|framing|contained|%s}} }}', image, name, amount, prob, content.id) | return string.format( | ||
'{{LinkСard|SideStyle=1|background-color=#d7d7ff0b|image=%s|name=%s%s%s {{#invoke:Prototypes/Хранилище/Предмет|main|framing|contained|%s}} }}', | |||
image, name, amount, prob, content.id | |||
) | |||
end | end | ||