Модуль:Entity Sprite/all: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 2: | Строка 2: | ||
local JsonPaths = require('Module:JsonPaths') | local JsonPaths = require('Module:JsonPaths') | ||
local prefix = JsonPaths.prefixFile() | local prefix = JsonPaths.prefixFile() | ||
local function filterSpriteData(spriteData, prototypeData, whitelistSet, blacklistSet, project) | |||
local result = {} | local result = {} | ||
for id, entry in pairs(spriteData) do | for id, entry in pairs(spriteData) do | ||
local protoEntry = prototypeData and prototypeData[id] or entry | |||
if shouldIncludeEntry(protoEntry, whitelistSet, blacklistSet) then | |||
if project == "" or JsonPaths.has(id, project) then | |||
result[id] = entry | |||
end | |||
end | end | ||
end | end | ||
| Строка 345: | Строка 344: | ||
local whitelistSet = buildSet(frame.args.whitelistParent) | local whitelistSet = buildSet(frame.args.whitelistParent) | ||
local blacklistSet = buildSet(frame.args.blacklistParent) | local blacklistSet = buildSet(frame.args.blacklistParent) | ||
local filteredData = filterSpriteData(spriteData, prototypeData, whitelistSet, blacklistSet, project) | |||
local filteredData = filterSpriteData(spriteData, prototypeData, whitelistSet, blacklistSet | |||
if action == "repeat" then | if action == "repeat" then | ||