Модуль:Сущность/data: различия между версиями
Pok (обсуждение | вклад) Нет описания правки |
Pok (обсуждение | вклад) Нет описания правки |
||
| Строка 162: | Строка 162: | ||
local function makeSourceLink(s) | local function makeSourceLink(s) | ||
local className = | local className = | ||
(s.name:sub(1,1):upper() .. s.name:sub(2)) .. | (s.name:sub(1, 1):upper() .. s.name:sub(2)) .. | ||
(s.kind and (s.kind:sub(1,1):upper() .. s.kind:sub(2)) or "") | (s.kind and (s.kind:sub(1, 1):upper() .. s.kind:sub(2)) or "") | ||
local tplLabel = "Template:" .. s.tplPath | local tplLabel = "Template:" .. s.tplPath | ||
| Строка 336: | Строка 336: | ||
local section = (callKey:find("_", 1, true)) and callKey:match("^([^_]+)") or "Сущность" | local section = (callKey:find("_", 1, true)) and callKey:match("^([^_]+)") or "Сущность" | ||
local isWhitelisted = cardFilter and matches_card_list(cardFilter.whitelist, callKey, compositeKey) or false | local isWhitelisted = cardFilter and matches_card_list(cardFilter.whitelist, callKey, compositeKey) or | ||
local isBlacklisted = cardFilter and matches_card_list(cardFilter.blacklist, callKey, compositeKey) or false | false | ||
local isBlacklisted = cardFilter and matches_card_list(cardFilter.blacklist, callKey, compositeKey) or | |||
false | |||
if isWhitelisted and content ~= "" then | if isWhitelisted and content ~= "" then | ||
rawContentParts[#rawContentParts + 1] = content | rawContentParts[#rawContentParts + 1] = content | ||
| Строка 392: | Строка 394: | ||
local hasLabel = false | local hasLabel = false | ||
for _, v in pairs(merged.labelOverrides or {}) do | for _, v in pairs(merged.labelOverrides or {}) do | ||
if v and v ~= "" then hasLabel = true break end | if v and v ~= "" then | ||
hasLabel = true | |||
break | |||
end | |||
end | end | ||
if not hasLabel then | if not hasLabel then | ||
for _, lst in pairs(merged.labelLists or {}) do | for _, lst in pairs(merged.labelLists or {}) do | ||
if #lst > 0 then hasLabel = true break end | if #lst > 0 then | ||
hasLabel = true | |||
break | |||
end | |||
end | end | ||
end | end | ||
| Строка 402: | Строка 410: | ||
local hasContent = false | local hasContent = false | ||
for _, v in pairs(merged.contentByKey or {}) do | for _, v in pairs(merged.contentByKey or {}) do | ||
if v and v ~= "" then hasContent = true break end | if v and v ~= "" then | ||
hasContent = true | |||
break | |||
end | |||
end | end | ||
| Строка 598: | Строка 609: | ||
local function collect_entity_sets(id, componentDefs, prototypeStoreDefs, | local function collect_entity_sets(id, componentDefs, prototypeStoreDefs, | ||
componentWhitelist, componentBlacklist, prototypeWhitelist, prototypeBlacklist) | |||
local foundComponents, foundPrototypes = {}, {} | local foundComponents, foundPrototypes = {}, {} | ||