Модуль:Serialization/EntityTableSelector: различия между версиями

Нет описания правки
Метка: отменено
Нет описания правки
Метка: ручная отмена
Строка 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 and onlyEntSelectors then
     elseif not hasWeight then
         title = "Может выпасть лишь один из:"
         title = "Может выпасть лишь один из:"
     end
     end