Модуль:Entity Sprite: различия между версиями

мНет описания правки
мНет описания правки
Строка 21: Строка 21:
-- Функция получения пути спрайта
-- Функция получения пути спрайта
local function getSpritePath(entry)
local function getSpritePath(entry)
     local spriteBlock = findFieldInsensitive(entry, "Sprite")
     local spriteBlock = findFieldInsensitive(entry, "Icon")
                     or findFieldInsensitive(entry, "Icon")
                     or findFieldInsensitive(entry, "Sprite")
     if not spriteBlock then
     if not spriteBlock then
         return nil
         return nil
Строка 46: Строка 46:
-- Функция получения state
-- Функция получения state
local function getSpriteState(entry)
local function getSpriteState(entry)
    local iconBlock = findFieldInsensitive(entry, "Icon")
    if iconBlock and iconBlock.state then
        return iconBlock.state
    end
     local spriteBlock = findFieldInsensitive(entry, "Sprite")
     local spriteBlock = findFieldInsensitive(entry, "Sprite")
     if spriteBlock then
     if spriteBlock then
Строка 57: Строка 62:
             end
             end
         end
         end
    end
    local iconBlock = findFieldInsensitive(entry, "Icon")
    if iconBlock and iconBlock.state then
        return iconBlock.state
     end
     end


     return nil
     return nil
end
end


-- Функция генерации шаблона по записи
-- Функция генерации шаблона по записи