поиск mimgui

- |2347| -

Активный
Автор темы
189
47
почему не работает нормально поиск ?

lua:
 for i, _ in ipairs(itemsBuy) do
                    if findBuf[0] ~= '' then
                        local isFounded = false
                            local pat1 = string.rlower(itemsBuy[i][1])
                            local pat2 = string.rlower(u8:decode(findBuf[0]))
                            --if pat1:find(pat2, 0, true) then

                                if pat1:find(pat2) then -- если значение с таблицы u8(v) совпадает со значением инпута ffi.string(search), то
                                
                          
                                if imgui.Button(tostring(i)) then
                                    if not check_table(itemsBuy[i][1], myitemsBuy) then
                                    table.insert(myitemsBuy, {itemsBuy[i][1], 1, 10, true})
                                    jsonSave(json_file_myBuyList, myitemsBuy)
                                    else
                                        local name = itemsBuy[i][1]
                                        table.remove(myitemsBuy, check_index(name, myitemsBuy))
                                        jsonSave(json_file_myBuyList, myitemsBuy)
                                end
                            end
                                imgui.Text(u8(itemsBuy[i][1]), imgui.SameLine())
                                isFounded = true
                            end
                        end
                    end