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

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


local function getSpritePath(entry)
local function getSpritePath(entry)
     if entry.Sprite and entry.Sprite.sprite then
     return entry.Sprite and entry.Sprite.sprite or (entry.Icon and entry.Icon.sprite)
        return entry.Sprite.sprite
    elseif entry.Icon and entry.Icon.sprite then
        return entry.Icon.sprite
    elseif entry.Sprite and entry.Sprite.layers then
        for _, layer in ipairs(entry.Sprite.layers) do
            if layer.sprite then
                return layer.sprite
            end
        end
    end
    return nil
end
end