Модуль:Serialization/EntityTableSelector: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки Метка: отменено |
||
| Строка 307: | Строка 307: | ||
local title = "" | local title = "" | ||
local hasWeight = rawget(selector, "weight") ~= nil | local hasWeight = rawget(selector, "weight") ~= nil | ||
local onlyEntSelectors = true | |||
for _, child in ipairs(selector.children) do | |||
local childSelector = normalizeSelector(child) | |||
if childSelector then | |||
if childSelector["!type"] ~= "EntSelector" then | |||
onlyEntSelectors = false | |||
break | |||
end | |||
elseif not (type(child) == "table" and trim(child.id) ~= "") then | |||
onlyEntSelectors = false | |||
break | |||
end | |||
end | |||
if hasWeight and selector.weight ~= "default" then | if hasWeight and selector.weight ~= "default" then | ||
title = "Группа предметов " .. normalizePercent(selector.weight, false) | title = "Группа предметов " .. normalizePercent(selector.weight, false) | ||
elseif not hasWeight then | elseif not hasWeight and onlyEntSelectors then | ||
title = "Может выпасть лишь один из:" | title = "Может выпасть лишь один из:" | ||
end | end | ||