Модуль:Песочница/Pok: различия между версиями

Нет описания правки
Нет описания правки
Строка 71: Строка 71:


     return string.format(
     return string.format(
         '{{LinkСard|SideStyle=1|background-color=#cbcbff0b|image=%s|name=%s%s%s {{#invoke:Prototypes/Хранилище/Предмет|main|framing|contained|%s}} }}',
         '{{LinkСard|SideStyle=1|background-color=#cbcbff0a|image=%s|name=%s%s%s {{#invoke:Prototypes/Хранилище/Предмет|main|framing|contained|%s}} }}',
         image, name, amount, prob, content.id
         image, name, amount, prob, content.id
     )
     )
Строка 123: Строка 123:
getContainedOutput = function(data, id)
getContainedOutput = function(data, id)
     local item = findDataById(data, id)
     local item = findDataById(data, id)
     if not item then return '' end
     if not item then return 'Ошибка: элемент не найден по ID.' end


     local result = {}
     local result = {}
Строка 139: Строка 139:
             if containers.entity_storage.children then
             if containers.entity_storage.children then
                 result[#result + 1] = processNestedSelectors(containers.entity_storage.children)
                 result[#result + 1] = processNestedSelectors(containers.entity_storage.children)
            else
                result[#result + 1] = '<div>Ошибка: нет children в entity_storage.</div>'
             end
             end


Строка 144: Строка 146:
                 result[#result + 1] = getTableOutput(containers.entity_storage.tableId)
                 result[#result + 1] = getTableOutput(containers.entity_storage.tableId)
             end
             end
        else
            result[#result + 1] = '<div>Ошибка: нет entity_storage в EntityTableContainerFill.</div>'
         end
         end


Строка 150: Строка 154:
             result[#result + 1] = getTableOutput(containers.storagebase.tableId)
             result[#result + 1] = getTableOutput(containers.storagebase.tableId)
         end
         end
    else
        result[#result + 1] = '<div>Ошибка: нет контейнеров в EntityTableContainerFill.</div>'
     end
     end


Строка 163: Строка 169:
-- Обработка GroupSelector
-- Обработка GroupSelector
handleGroupSelector = function(groupSelector)
handleGroupSelector = function(groupSelector)
     if not groupSelector.children then return '' end
     if not groupSelector.children then
        return '<div>Ошибка: нет children в GroupSelector.</div>'
    end
     local result = {}
     local result = {}
     local wrapperStart, wrapperEnd = "", ""
     local wrapperStart, wrapperEnd = "", ""