Модуль:Entity Sprite: различия между версиями
Pok (обсуждение | вклад) мНет описания правки |
Pok (обсуждение | вклад) мНет описания правки |
||
| Строка 21: | Строка 21: | ||
-- Функция получения пути спрайта | -- Функция получения пути спрайта | ||
local function getSpritePath(entry) | local function getSpritePath(entry) | ||
local spriteBlock = findFieldInsensitive(entry, " | local spriteBlock = findFieldInsensitive(entry, "Icon") | ||
or findFieldInsensitive(entry, " | 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 | end | ||
return nil | return nil | ||
end | end | ||
-- Функция генерации шаблона по записи | -- Функция генерации шаблона по записи | ||