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

мНет описания правки
мНет описания правки
Строка 179: Строка 179:
     -- Проверка для контейнера EntityTableContainerFill
     -- Проверка для контейнера EntityTableContainerFill
     if groupSelector.weight and groupSelector.weight ~= "default" then
     if groupSelector.weight and groupSelector.weight ~= "default" then
         wrapperStart = string.format('{{LinkСard/Сollapsible|name=Группа [%s]|content=', groupSelector.weight)
         wrapperStart = string.format('{{LinkСard/Сollapsible|name=Группа %s%|content=', groupSelector.weight)
         wrapperEnd = "}}"
         wrapperEnd = "}}"
     elseif groupSelector["!type"] == "GroupSelector" and not groupSelector.weight then
     elseif groupSelector["!type"] == "GroupSelector" and not groupSelector.weight then
         wrapperStart = '{{LinkСard/Сollapsible|name=Попадаётся только один из|content='
         wrapperStart = '{{LinkСard/Сollapsible|name=Может выпасть лишь один из|content='
         wrapperEnd = "}}"
         wrapperEnd = "}}"
     end
     end
Строка 190: Строка 190:
             result[#result + 1] = handleGroupSelector(child)
             result[#result + 1] = handleGroupSelector(child)
         elseif child["!type"] == "AllSelector" then
         elseif child["!type"] == "AllSelector" then
             result[#result + 1] = string.format('{{LinkСard/Сollapsible|name=Попадаются только вместе|content=%s}}', handleAllSelector(child))
             result[#result + 1] = string.format('{{LinkСard/Сollapsible|name=Выпадают только вместе|content=%s}}', handleAllSelector(child))
         elseif child.id then
         elseif child.id then
             result[#result + 1] = formatContent(child)
             result[#result + 1] = formatContent(child)
Строка 211: Строка 211:
     if wrapped then
     if wrapped then
         if nestedSelector.rolls and nestedSelector.rolls.range then
         if nestedSelector.rolls and nestedSelector.rolls.range then
             classesRolls = processRolls(nestedSelector.rolls)
             classesRolls = ', максимум может выпасть ' .. processRolls(nestedSelector.rolls)
         end
         end
         if nestedSelector.prob then
         if nestedSelector.prob then
Строка 220: Строка 220:
if wrapped and (classesRolls or classesProb) then
if wrapped and (classesRolls or classesProb) then
    if (classesRolls and #classesRolls > 0) or (classesProb and #classesProb > 0) then
    if (classesRolls and #classesRolls > 0) or (classesProb and #classesProb > 0) then
        result[#result + 1] = string.format('{{LinkСard/Сollapsible|name=Группа %s%s|content=', classesRolls or "", classesProb or "")
        result[#result + 1] = string.format('{{LinkСard/Сollapsible|name=Группа предметов %s%s|content=', classesRolls or "", classesProb or "")
    end
    end
end
end