Модуль:Entity Sprite

Материал из Space Station 14 Вики

Шаблон:Entity Sprite


local data = mw.loadData("Module:Entity Sprite/data")

local p = {}

function p.getData()
    return data
end

function p.getSprite(frame)
    local id = frame.args[1]
    if not id then return "Ошибка: не указан ID" end

    for _, entry in ipairs(data) do
        if entry.id == id then
            return entry.Sprite and entry.Sprite.sprite or "Ошибка: спрайт не найден"
        end
    end

    return "Ошибка: ID не найден"
end

return p