filter: add get_keyword method to filter, use them for searches instead of group name
get_keyword is now responsible if a group is visible or not
This commit is contained in:
parent
c07c4fcabd
commit
09490fbd5f
7
API.md
7
API.md
@ -31,6 +31,7 @@ smart_inventory.filter.register_filter({
|
|||||||
name = string,
|
name = string,
|
||||||
check_item_by_def = function,
|
check_item_by_def = function,
|
||||||
get_description = function,
|
get_description = function,
|
||||||
|
get_keyword = function,
|
||||||
})
|
})
|
||||||
```
|
```
|
||||||
- name - unique filter name
|
- name - unique filter name
|
||||||
@ -40,8 +41,9 @@ smart_inventory.filter.register_filter({
|
|||||||
- string -> dimension, steps splitted by ":" (`a:b:c:d results in filtername, filtername:a, filtername:a:b, filtername:a:b:c, filtername:a:b:c:d`)
|
- string -> dimension, steps splitted by ":" (`a:b:c:d results in filtername, filtername:a, filtername:a:b, filtername:a:b:c, filtername:a:b:c:d`)
|
||||||
- key/value table -> multiple groups assignment. Values could be dimensions as above (`{a,b} results in filtername, filtername:a, filtername:b`)
|
- key/value table -> multiple groups assignment. Values could be dimensions as above (`{a,b} results in filtername, filtername:a, filtername:b`)
|
||||||
- nil -> no group assingment by this filter
|
- nil -> no group assingment by this filter
|
||||||
- shortdesc_func(fltobj, filterstring, textstring) - optional - get human readable description for the dimension string (`filtername:a:b:c`). "false" means the group should be ignored. Usefull so skip some dimension characteristics
|
- get_description(fltobj, group) - optional - get human readable description for the dimension string (`filtername:a:b:c`)
|
||||||
- if no function is given the descriptions can be added to smart_inventory.txt[filterstring].label See classify_description.lua. If nothing defined the filterstring will be displayed
|
- get_keyword(fltobj, group) - get string that should be used for searches or nil if the group should not be matched
|
||||||
|
|
||||||
|
|
||||||
### Filter Object methods
|
### Filter Object methods
|
||||||
|
|
||||||
@ -49,3 +51,4 @@ smart_inventory.filter.get(name) get filter object by registered name. Ret
|
|||||||
- fltobj:check_item_by_name(itemname) classify by itemname (wrapper for check_item_by_def)
|
- fltobj:check_item_by_name(itemname) classify by itemname (wrapper for check_item_by_def)
|
||||||
- fltobj:check_item_by_def(def) classify by item definition
|
- fltobj:check_item_by_def(def) classify by item definition
|
||||||
- fltobj:get_description(group) get group description
|
- fltobj:get_description(group) get group description
|
||||||
|
- fltobj:get_keyword(group) get string that should be used for searches
|
||||||
|
@ -250,17 +250,9 @@ function cache.add_to_cache_group(group_name, itemdef, flt, parent, parent_value
|
|||||||
childs = {},
|
childs = {},
|
||||||
}
|
}
|
||||||
|
|
||||||
if flt then
|
group.group_desc = flt:get_description(group)
|
||||||
group.group_desc = flt:get_description(group)
|
group.keyword = flt:get_keyword(group)
|
||||||
else
|
|
||||||
group.group_desc = group_name
|
|
||||||
end
|
|
||||||
if not group.group_desc then
|
|
||||||
if parent_ref then
|
|
||||||
parent_ref.childs[group_name] = nil
|
|
||||||
end
|
|
||||||
return
|
|
||||||
end
|
|
||||||
cache.cgroups[group_name] = group
|
cache.cgroups[group_name] = group
|
||||||
end
|
end
|
||||||
cache.cgroups[group_name].items[itemdef.name] = itemdef
|
cache.cgroups[group_name].items[itemdef.name] = itemdef
|
||||||
|
@ -1,11 +1,12 @@
|
|||||||
local txt = smart_inventory.txt
|
local txt = smart_inventory.txt
|
||||||
local txt_usage = minetest.setting_get("smart_inventory_friendly_group_names") or false
|
local txt_usage = minetest.setting_get("smart_inventory_friendly_group_names") or true
|
||||||
|
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
-- Filter class
|
-- Filter class
|
||||||
--------------------------------------------------------------
|
--------------------------------------------------------------
|
||||||
local filter_class = {}
|
local filter_class = {}
|
||||||
filter_class.__index = filter_class
|
filter_class.__index = filter_class
|
||||||
|
|
||||||
function filter_class:check_item_by_name(itemname)
|
function filter_class:check_item_by_name(itemname)
|
||||||
if minetest.registered_items[itemname] then
|
if minetest.registered_items[itemname] then
|
||||||
return self:check_item_by_def(minetest.registered_items[itemname])
|
return self:check_item_by_def(minetest.registered_items[itemname])
|
||||||
@ -25,7 +26,7 @@ function filter_class:_get_description(group)
|
|||||||
else
|
else
|
||||||
ret_desc = group.name
|
ret_desc = group.name
|
||||||
end
|
end
|
||||||
if not txt_usage or ret_desc == false then
|
if txt_usage then
|
||||||
return ret_desc
|
return ret_desc
|
||||||
else
|
else
|
||||||
return group.name
|
return group.name
|
||||||
@ -33,6 +34,25 @@ function filter_class:_get_description(group)
|
|||||||
end
|
end
|
||||||
filter_class.get_description = filter_class._get_description
|
filter_class.get_description = filter_class._get_description
|
||||||
|
|
||||||
|
|
||||||
|
function filter_class:_get_keyword(group)
|
||||||
|
-- parent exists - return the top-level information only
|
||||||
|
if group.parent and group.parent.childs[group.name] and tonumber(group.parent.childs[group.name]) == nil then
|
||||||
|
return group.parent.childs[group.name]
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
function filter_class:_get_keyword_groupname(group) -- a variant for get_keyword, can be assigned in filter definition
|
||||||
|
if txt_usage then
|
||||||
|
return group.name.." "..group.group_desc
|
||||||
|
else
|
||||||
|
return group.name
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
filter_class.get_keyword = filter_class._get_keyword
|
||||||
|
|
||||||
|
|
||||||
local filter = {}
|
local filter = {}
|
||||||
filter.registered_filter = {}
|
filter.registered_filter = {}
|
||||||
|
|
||||||
@ -49,6 +69,9 @@ function filter.register_filter(def)
|
|||||||
filter.registered_filter[def.name] = def
|
filter.registered_filter[def.name] = def
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--------------------------------------------------------------
|
||||||
|
-- Filter group
|
||||||
|
--------------------------------------------------------------
|
||||||
filter.register_filter({
|
filter.register_filter({
|
||||||
name = "group",
|
name = "group",
|
||||||
check_item_by_def = function(self, def)
|
check_item_by_def = function(self, def)
|
||||||
@ -68,6 +91,7 @@ filter.register_filter({
|
|||||||
else
|
else
|
||||||
mk = k
|
mk = k
|
||||||
end
|
end
|
||||||
|
|
||||||
-- stack wear related value
|
-- stack wear related value
|
||||||
if k == "armor_use" then
|
if k == "armor_use" then
|
||||||
mv = tostring(math.floor(v / 65535 * 10000 + 0.5)/100).." %"
|
mv = tostring(math.floor(v / 65535 * 10000 + 0.5)/100).." %"
|
||||||
@ -78,12 +102,29 @@ filter.register_filter({
|
|||||||
mv = true
|
mv = true
|
||||||
end
|
end
|
||||||
|
|
||||||
if v ~= 0 then
|
-- replacements
|
||||||
|
if mk == "group:customnode:default" then
|
||||||
|
mk = "group:customnode"
|
||||||
|
end
|
||||||
|
|
||||||
|
-- apply
|
||||||
|
if v ~= 0 and not (
|
||||||
|
mk == "group:armor:count" or --internally used only
|
||||||
|
mk == "group:leafdecay" ) -- represented by group:leaves
|
||||||
|
then
|
||||||
ret[mk] = mv
|
ret[mk] = mv
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return ret
|
return ret
|
||||||
end,
|
end,
|
||||||
|
get_keyword = function(self, group)
|
||||||
|
local keyword = self:_get_keyword(group)
|
||||||
|
if txt_usage and keyword then
|
||||||
|
return keyword.." "..group.group_desc
|
||||||
|
else
|
||||||
|
return keyword
|
||||||
|
end
|
||||||
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
filter.register_filter({
|
filter.register_filter({
|
||||||
@ -104,7 +145,8 @@ filter.register_filter({
|
|||||||
name = "transluc",
|
name = "transluc",
|
||||||
check_item_by_def = function(self, def)
|
check_item_by_def = function(self, def)
|
||||||
return def.sunlight_propagates
|
return def.sunlight_propagates
|
||||||
end
|
end,
|
||||||
|
get_keyword = filter_class._get_keyword_groupname
|
||||||
})
|
})
|
||||||
|
|
||||||
filter.register_filter({
|
filter.register_filter({
|
||||||
@ -113,7 +155,8 @@ filter.register_filter({
|
|||||||
if def.light_source and def.light_source ~= 0 then
|
if def.light_source and def.light_source ~= 0 then
|
||||||
return def.light_source
|
return def.light_source
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
|
get_keyword = filter_class._get_keyword_groupname
|
||||||
})
|
})
|
||||||
|
|
||||||
filter.register_filter({
|
filter.register_filter({
|
||||||
@ -124,7 +167,8 @@ filter.register_filter({
|
|||||||
def.on_metadata_inventory_put then
|
def.on_metadata_inventory_put then
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
|
get_keyword = filter_class._get_keyword_groupname
|
||||||
})
|
})
|
||||||
|
|
||||||
--[[ does it sense to filter them? I cannot define the human readable groups for them
|
--[[ does it sense to filter them? I cannot define the human readable groups for them
|
||||||
@ -154,7 +198,8 @@ filter.register_filter({
|
|||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
|
get_keyword = filter_class._get_keyword_groupname
|
||||||
})
|
})
|
||||||
|
|
||||||
filter.register_filter({
|
filter.register_filter({
|
||||||
@ -166,7 +211,8 @@ filter.register_filter({
|
|||||||
return tostring(change)
|
return tostring(change)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
|
get_keyword = filter_class._get_keyword_groupname
|
||||||
})
|
})
|
||||||
|
|
||||||
filter.register_filter({
|
filter.register_filter({
|
||||||
@ -178,7 +224,8 @@ filter.register_filter({
|
|||||||
return tostring(change)
|
return tostring(change)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end,
|
||||||
|
get_keyword = filter_class._get_keyword_groupname
|
||||||
})
|
})
|
||||||
|
|
||||||
filter.register_filter({
|
filter.register_filter({
|
||||||
@ -211,11 +258,11 @@ filter.register_filter({
|
|||||||
]]
|
]]
|
||||||
return rettab
|
return rettab
|
||||||
end,
|
end,
|
||||||
get_description = function(self, group)
|
get_keyword = function(self, group)
|
||||||
if group.name == "max_drop_level" or group.name == "full_punch_interval" or group.name == "damage" then
|
if group.name == "max_drop_level" or group.name == "full_punch_interval" or group.name == "damage" then
|
||||||
return false
|
return nil
|
||||||
else
|
else
|
||||||
return self:_get_description(group)
|
return self:_get_keyword(group)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
@ -224,7 +271,8 @@ filter.register_filter({
|
|||||||
name = "armor",
|
name = "armor",
|
||||||
check_item_by_def = function(self, def)
|
check_item_by_def = function(self, def)
|
||||||
return def.armor_groups
|
return def.armor_groups
|
||||||
end
|
end,
|
||||||
|
get_keyword = filter_class._get_keyword_groupname
|
||||||
})
|
})
|
||||||
|
|
||||||
-- Group assignment done in cache framework internally
|
-- Group assignment done in cache framework internally
|
||||||
@ -245,7 +293,14 @@ filter.register_filter({
|
|||||||
else
|
else
|
||||||
return group.name
|
return group.name
|
||||||
end
|
end
|
||||||
|
end,
|
||||||
|
get_keyword = function(self, group)
|
||||||
|
local itemname = group.name:sub(12)
|
||||||
|
if minetest.registered_items[itemname] then
|
||||||
|
return minetest.registered_items[itemname].description
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
----------------
|
----------------
|
||||||
|
@ -6,7 +6,6 @@ return {
|
|||||||
["group:armor"] = { label = "Rüstung" },
|
["group:armor"] = { label = "Rüstung" },
|
||||||
["group:armor:state"] = { label = "Rüstungsstatus" },
|
["group:armor:state"] = { label = "Rüstungsstatus" },
|
||||||
["group:armor:level"] = { label = "Level der Rüstung" },
|
["group:armor:level"] = { label = "Level der Rüstung" },
|
||||||
["group:armor:count"] = { label = false },
|
|
||||||
["group:physics:jump"] = { label = "Sprunghöhe" },
|
["group:physics:jump"] = { label = "Sprunghöhe" },
|
||||||
["group:physics:speed"] = { label = "Geschwindigkeit" },
|
["group:physics:speed"] = { label = "Geschwindigkeit" },
|
||||||
["group:physics:gravity"] = { label = "Erdanziehung" },
|
["group:physics:gravity"] = { label = "Erdanziehung" },
|
||||||
@ -22,11 +21,9 @@ return {
|
|||||||
|
|
||||||
-- http://dev.minetest.net/Groups
|
-- http://dev.minetest.net/Groups
|
||||||
-- http://dev.minetest.net/Groups/Custom_groups
|
-- http://dev.minetest.net/Groups/Custom_groups
|
||||||
["group"] = { label = false },
|
|
||||||
["group:level"] = { label = "Wertvoll" },
|
["group:level"] = { label = "Wertvoll" },
|
||||||
["group:oddly_breakable_by_hand"] = { label = "Ohne Werkzeug abbaubar" },
|
["group:oddly_breakable_by_hand"] = { label = "Ohne Werkzeug abbaubar" },
|
||||||
["group:dig_immediate"] = { label = false },
|
["group:dig_immediate"] = { label = "Schnell abbaubar" },
|
||||||
["group:dig_immediate:2"] = { label = "Schnell abbaubar" },
|
|
||||||
["group:dig_immediate:3"] = { label = "Sofort abbaubar" },
|
["group:dig_immediate:3"] = { label = "Sofort abbaubar" },
|
||||||
["group:disable_jump"] = { label = "Klebrig" },
|
["group:disable_jump"] = { label = "Klebrig" },
|
||||||
["group:bouncy"] = { label = "Federnd" },
|
["group:bouncy"] = { label = "Federnd" },
|
||||||
@ -40,10 +37,9 @@ return {
|
|||||||
["group:choppy"] = { label = "Abgehackt" },
|
["group:choppy"] = { label = "Abgehackt" },
|
||||||
["group:explody"] = { label = "Explosiv" },
|
["group:explody"] = { label = "Explosiv" },
|
||||||
["group:flammable"] = { label = "Brennbar" },
|
["group:flammable"] = { label = "Brennbar" },
|
||||||
["group:not_in_creative_inventory"] = { label = false },
|
["group:not_in_creative_inventory"] = { label = "Versteckt" },
|
||||||
|
|
||||||
["group:tree"] = { label = "Baum" },
|
["group:tree"] = { label = "Baum" },
|
||||||
["group:leafdecay"] = { label = false }, -- represented by group:leaves
|
|
||||||
["group:flora"] = { label = "Flora" },
|
["group:flora"] = { label = "Flora" },
|
||||||
["group:soil"] = { label = "Erde" },
|
["group:soil"] = { label = "Erde" },
|
||||||
["group:soil:1"] = { label = "Ackerboden" },
|
["group:soil:1"] = { label = "Ackerboden" },
|
||||||
@ -72,8 +68,6 @@ return {
|
|||||||
["group:panel"] = {label = "Paneel"},
|
["group:panel"] = {label = "Paneel"},
|
||||||
["group:slope"] = {label = "Neigung"},
|
["group:slope"] = {label = "Neigung"},
|
||||||
["group:customnode"] = {label = "Dekorativer Block"},
|
["group:customnode"] = {label = "Dekorativer Block"},
|
||||||
["group:customnode:default"] = {label = false},
|
|
||||||
|
|
||||||
|
|
||||||
["type:tool"] = { label = "Werkzeuge" },
|
["type:tool"] = { label = "Werkzeuge" },
|
||||||
["type:node"] = { label = "Blöcke" },
|
["type:node"] = { label = "Blöcke" },
|
||||||
@ -83,12 +77,11 @@ return {
|
|||||||
["mod"] = { label = "Mod" },
|
["mod"] = { label = "Mod" },
|
||||||
["transluc"] = { label = "Lichtdurchlässig" },
|
["transluc"] = { label = "Lichtdurchlässig" },
|
||||||
["vessel"] = { label = "Behälter" },
|
["vessel"] = { label = "Behälter" },
|
||||||
["eatable"] = { label = "Nahrung" },
|
["food"] = { label = "Nahrung" },
|
||||||
["shape"] = { label = "Geformt"},
|
["shape"] = { label = "Geformt"},
|
||||||
["light"] = { label = "Lichtquelle"},
|
["light"] = { label = "Lichtquelle"},
|
||||||
["ingredient"] = { label = "Erzeugt aus"},
|
["ingredient"] = { label = "Erzeugt aus"},
|
||||||
|
|
||||||
["tool"] = {label = false},
|
|
||||||
["tool:full_punch_interval"] = { label = "Verwendungsinterval" },
|
["tool:full_punch_interval"] = { label = "Verwendungsinterval" },
|
||||||
["tool:max_drop_level"] = { label = "Max drop Level" },
|
["tool:max_drop_level"] = { label = "Max drop Level" },
|
||||||
-- ["tool:groupcaps:fleshy"] = { label = "??" },
|
-- ["tool:groupcaps:fleshy"] = { label = "??" },
|
||||||
|
@ -6,7 +6,6 @@ return {
|
|||||||
["group:armor"] = { label = "Armor" },
|
["group:armor"] = { label = "Armor" },
|
||||||
["group:armor:state"] = { label = "Armor state" },
|
["group:armor:state"] = { label = "Armor state" },
|
||||||
["group:armor:level"] = { label = "Armor level" },
|
["group:armor:level"] = { label = "Armor level" },
|
||||||
["group:armor:count"] = { label = false },
|
|
||||||
["group:physics:jump"] = { label = "Jump high" },
|
["group:physics:jump"] = { label = "Jump high" },
|
||||||
["group:physics:speed"] = { label = "Walking speed" },
|
["group:physics:speed"] = { label = "Walking speed" },
|
||||||
["group:physics:gravity"] = { label = "Gravity" },
|
["group:physics:gravity"] = { label = "Gravity" },
|
||||||
@ -22,11 +21,9 @@ return {
|
|||||||
|
|
||||||
-- http://dev.minetest.net/Groups
|
-- http://dev.minetest.net/Groups
|
||||||
-- http://dev.minetest.net/Groups/Custom_groups
|
-- http://dev.minetest.net/Groups/Custom_groups
|
||||||
["group"] = { label = false },
|
|
||||||
["group:level"] = { label = "Valuable" },
|
["group:level"] = { label = "Valuable" },
|
||||||
["group:oddly_breakable_by_hand"] = { label = "Oddly breakable" },
|
["group:oddly_breakable_by_hand"] = { label = "Oddly breakable" },
|
||||||
["group:dig_immediate"] = { label = false },
|
["group:dig_immediate"] = { label = "Fast diggable" },
|
||||||
["group:dig_immediate:2"] = { label = "Fast diggable" },
|
|
||||||
["group:dig_immediate:3"] = { label = "Immediate diggable" },
|
["group:dig_immediate:3"] = { label = "Immediate diggable" },
|
||||||
["group:disable_jump"] = { label = "Sticky" },
|
["group:disable_jump"] = { label = "Sticky" },
|
||||||
["group:bouncy"] = { label = "Bouncy" },
|
["group:bouncy"] = { label = "Bouncy" },
|
||||||
@ -40,10 +37,9 @@ return {
|
|||||||
["group:choppy"] = { label = "Choppy" },
|
["group:choppy"] = { label = "Choppy" },
|
||||||
["group:explody"] = { label = "Explosive" },
|
["group:explody"] = { label = "Explosive" },
|
||||||
["group:flammable"] = { label = "Flammable" },
|
["group:flammable"] = { label = "Flammable" },
|
||||||
["group:not_in_creative_inventory"] = { label = false },
|
["group:not_in_creative_inventory"] = { label = "Hidden" },
|
||||||
|
|
||||||
["group:tree"] = { label = "Tree" },
|
["group:tree"] = { label = "Tree" },
|
||||||
["group:leafdecay"] = { label = false }, -- represented by group:leaves
|
|
||||||
["group:flora"] = { label = "Flora" },
|
["group:flora"] = { label = "Flora" },
|
||||||
["group:soil"] = { label = "Soil" },
|
["group:soil"] = { label = "Soil" },
|
||||||
["group:soil:1"] = { label = "Basic soil" },
|
["group:soil:1"] = { label = "Basic soil" },
|
||||||
@ -72,7 +68,6 @@ return {
|
|||||||
["group:panel"] = {label = "Panel"},
|
["group:panel"] = {label = "Panel"},
|
||||||
["group:slope"] = {label = "Slope"},
|
["group:slope"] = {label = "Slope"},
|
||||||
["group:customnode"] = {label = "Decorative node"},
|
["group:customnode"] = {label = "Decorative node"},
|
||||||
["group:customnode:default"] = {label = false},
|
|
||||||
|
|
||||||
["type:tool"] = { label = "Tools" },
|
["type:tool"] = { label = "Tools" },
|
||||||
["type:node"] = { label = "Nodes" },
|
["type:node"] = { label = "Nodes" },
|
||||||
@ -87,7 +82,6 @@ return {
|
|||||||
["light"] = { label = "Light source"},
|
["light"] = { label = "Light source"},
|
||||||
["ingredient"] = { label = "Crafted with"},
|
["ingredient"] = { label = "Crafted with"},
|
||||||
|
|
||||||
["tool"] = {label = false},
|
|
||||||
["tool:full_punch_interval"] = { label = "Punch interval" },
|
["tool:full_punch_interval"] = { label = "Punch interval" },
|
||||||
["tool:max_drop_level"] = { label = "Max drop level" },
|
["tool:max_drop_level"] = { label = "Max drop level" },
|
||||||
-- ["tool:groupcaps:fleshy"] = { label = "??" },
|
-- ["tool:groupcaps:fleshy"] = { label = "??" },
|
||||||
|
@ -98,11 +98,7 @@ local cache = smart_inventory.cache
|
|||||||
table.insert(filtered_list, entry)
|
table.insert(filtered_list, entry)
|
||||||
else
|
else
|
||||||
for _, cgroup in pairs(entry.citem.cgroups) do
|
for _, cgroup in pairs(entry.citem.cgroups) do
|
||||||
local prefix_end_pos = cgroup.name:find(":")
|
if cgroup.keyword and string.find(cgroup.keyword:lower(), search_string) then
|
||||||
if string.find(cgroup.name:lower(), search_string, prefix_end_pos) then
|
|
||||||
table.insert(filtered_list, entry)
|
|
||||||
break
|
|
||||||
elseif string.find(cgroup.group_desc:lower(), search_string) then
|
|
||||||
table.insert(filtered_list, entry)
|
table.insert(filtered_list, entry)
|
||||||
break
|
break
|
||||||
end
|
end
|
||||||
@ -129,7 +125,7 @@ end
|
|||||||
function ui_tools.get_tight_groups(cgroups)
|
function ui_tools.get_tight_groups(cgroups)
|
||||||
local out_list = {}
|
local out_list = {}
|
||||||
for group1, groupdef1 in pairs(cgroups) do
|
for group1, groupdef1 in pairs(cgroups) do
|
||||||
if not string.find(group1, "ingredient:") then
|
if not string.find(group1, "ingredient:") and groupdef1.keyword then
|
||||||
out_list[group1] = groupdef1
|
out_list[group1] = groupdef1
|
||||||
for group2, groupdef2 in pairs(out_list) do
|
for group2, groupdef2 in pairs(out_list) do
|
||||||
if string.len(group1) > string.len(group2) and
|
if string.len(group1) > string.len(group2) and
|
||||||
|
Loading…
x
Reference in New Issue
Block a user