mirror of
https://github.com/minetest-mods/i3.git
synced 2025-03-20 11:40:27 +01:00
Searches are now additive (Google-like)
This commit is contained in:
parent
d0ff046873
commit
6f588e1927
17
init.lua
17
init.lua
@ -117,6 +117,10 @@ end
|
|||||||
local old_is_creative_enabled = core.is_creative_enabled
|
local old_is_creative_enabled = core.is_creative_enabled
|
||||||
|
|
||||||
function core.is_creative_enabled(name)
|
function core.is_creative_enabled(name)
|
||||||
|
if name == "" then
|
||||||
|
return old_is_creative_enabled(name)
|
||||||
|
end
|
||||||
|
|
||||||
return check_privs(name, {creative = true}) or old_is_creative_enabled(name)
|
return check_privs(name, {creative = true}) or old_is_creative_enabled(name)
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -616,7 +620,18 @@ local function search(data)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
to_add = find(search_in, filter, 1, true)
|
local ok = true
|
||||||
|
|
||||||
|
for keyword in gmatch(filter, "%S+") do
|
||||||
|
if not find(search_in, keyword, 1, true) then
|
||||||
|
ok = nil
|
||||||
|
break
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if ok then
|
||||||
|
to_add = true
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if to_add then
|
if to_add then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user