Filter options: game.get_filtered_xxxxx_prototypes(filters)
Posted: Fri Sep 13, 2019 10:27 am
I use these methods when I can and it is very cool and faster
Filter group and subgroup:
for example in LuaRecipePrototypeFilters there are 2 filters
if you want the subgroup list you must parse all recipes before to build the subgroup list when there are lot of recipe is bad, if we can have a subgroup list similar at LuaRecipeCategoryPrototype
Why? there is not filter group for LuaRecipePrototypeFilters (not yet?)
Proposal:
when I try to filter recipes by the contain value in the name of the product or ingredient, it is quickly a problem of performance in lua
if we can have a filter similar at string.find(s, pattern [, index [, plain]])
Proposal:
Filter group and subgroup:
for example in LuaRecipePrototypeFilters there are 2 filters
Code: Select all
"subgroup": Additional fields:
subgroup :: string: A LuaGroup (subgroup) name
"category": Additional fields:
category :: string: A LuaRecipeCategoryPrototype name
Why? there is not filter group for LuaRecipePrototypeFilters (not yet?)
Proposal:
- add group filter where prototype has group
- add subgroup filter where prototype has subgroup
- add a solution to get group and subgroup without table loop to build it
when I try to filter recipes by the contain value in the name of the product or ingredient, it is quickly a problem of performance in lua
if we can have a filter similar at string.find(s, pattern [, index [, plain]])
Proposal:
- add find filter on string attribut, sample:
Code: Select all
"find": Additional fields: attribut:: AttributString value :: string: The value to find in the attribut.
- LuaRecipePrototypeFilters, add find product filter on string attribut of a recipe product, sample:
Code: Select all
"find_by_product": Additional fields: attribut:: AttributString value :: string: The value to find in the attribut.
- LuaRecipePrototypeFilters, add find ingredient filter on string attribut of a recipe ingredient, sample:
Code: Select all
"find_by_ingredient": Additional fields: attribut:: AttributString value :: string: The value to find in the attribut.