Add screenshots and a README to display them.
This commit is contained in:
parent
ce6cb893bf
commit
48ffa74bfd
12 changed files with 229 additions and 168 deletions
|
|
@ -42,14 +42,24 @@ local function search_settings(state, search)
|
|||
return state.settings, state.categories
|
||||
end
|
||||
|
||||
local words = search:lower():trim():split(" ")
|
||||
|
||||
local out = {}
|
||||
for category, settings in pairs(state.settings) do
|
||||
for i = 1, #settings do
|
||||
if settings[i].name:find(search, 1, true) then
|
||||
if not out[category] then
|
||||
out[category] = {settings[i]}
|
||||
else
|
||||
table.insert(out[category], settings[i])
|
||||
for j = 1, #words do
|
||||
local passed = true
|
||||
if not (settings[i].readable_name:lower():find(words[j], 1, true)
|
||||
or settings[i].name:find(words[j], 1, true)) then
|
||||
passed = false
|
||||
end
|
||||
|
||||
if passed then
|
||||
if not out[category] then
|
||||
out[category] = {settings[i]}
|
||||
else
|
||||
table.insert(out[category], settings[i])
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue