Skip to main content

Recipes Filter

Based on game build 714014 | Last updated: 2026-03-10

Overview

recipes_filter.lua defines the structure and contents of crafting menu filters used in the game’s UI. It establishes CRAFTING_FILTER_DEFS, a list of filter definitions (each specifying name, icon atlas, image, and optional properties), and populates CRAFTING_FILTERS, a lookup table mapping filter names to their definitions. Each filter includes a recipes list (or function) that determines which recipes belong to that filter. Helper functions GetCharacterAtlas, GetCharacterImage, and GetCraftingMenuAtlas compute file paths for filter icons, supporting mod characters and fallbacks. This module does not manage state or components; it is a pure data configuration file.

Usage example

-- Access a specific filter's recipe list
local filters = require("recipes_filter")

-- Iterate over all filters and print their names and recipe counts
for name, filter in pairs(filters.CRAFTING_FILTERS) do
if type(filter.recipes) == "table" then
print(name .. ": " .. #filter.recipes .. " recipes")
elseif type(filter.recipes) == "function" then
print(name .. ": dynamic recipe list")
end
end

-- Get recipes for a specific filter
local tools = filters.CRAFTING_FILTERS.TOOLS.recipes

Dependencies & tags

Components used: None identified
Tags: None identified

Properties

PropertyTypeDefault ValueDescription
CRAFTING_FILTER_DEFSarray of tablesOrdered list of filter definitions; each table contains name, atlas, image, image_size, custom_pos, and recipes keys.
CRAFTING_FILTERStablenil → populated at load timeLookup table mapping filter names (e.g., "TOOLS", "CHARACTER") to their corresponding definition tables.
GetCharacterAtlas(owner)functionReturns atlas file path for a character’s avatar, with mod-specific fallback logic.
GetCharacterImage(owner)functionReturns image filename (avatar_<prefab>.tex or avatar_mod.tex).
GetCraftingMenuAtlas()functionReturns the base crafting menu atlas path.

Main functions

Not applicable — this file defines data structures and helper functions but no public methods attached to components.

Events & listeners

Not applicable — this file does not register or dispatch events.