Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/playercards/AllCardsBag.ttslua
Original file line number Diff line number Diff line change
Expand Up @@ -509,8 +509,9 @@ end

-- Expects a table like { [1] = true, [2] = false, [0] = true }
function getFilteredContent(activeChapters)
local matches = {}
local seen = {}
local matches = {}
local seen = {}
local hasOther = false

local function processCycle(cycleName)
if seen[cycleName] then return end
Expand All @@ -519,6 +520,7 @@ function getFilteredContent(activeChapters)
if activeChapters[chapter] and cycleIndex[cycleName] and cycleHasSpawnableCards(cycleName) then
table.insert(matches, toTitleCase(cycleName))
seen[cycleName] = true
if cycleName == "other" then hasOther = true end
end
end

Expand All @@ -532,6 +534,10 @@ function getFilteredContent(activeChapters)
processCycle(cycleName)
end

if not hasOther then
table.insert(matches, "Other")
end

return matches
end

Expand Down
Loading