imgui clipper + 1 фпс

Slavka Priore

Участник
Автор темы
85
31
Версия MoonLoader
.026-beta
У меня в имгуи дофига кнопочек + цикл с массивом, из за этого фпс уходит на дно. Мне говорили сделать както через imgui list clipper, но я нихера но понимаю. Помогите😳

Щас сделал какуюто ерунду
Lua:
                    for i, f in ipairs(BuyItems) do
                                while clipper:Step() do
                                for g = clipper.DisplayStart + 1, clipper.DisplayEnd do
                                if imgui.Button(tostring('%s - %s'):format(i,u8(f)), imgui.ImVec2(res.x / 4.3 , res.y / 40)) then
                                    table.insert(myBuyItems, {f, 1, 10, true})
                                    jsonSave(json_file_myBuyList, myBuyItems)
                                end
                                end
                        end
                    end
Теперь фпс в норме, но вместо нормальных кнопок отображается фигня
1708214593835.png

Все строки в одном элементе
 
Последнее редактирование:
Решение
так я сделал как там, но видешь какая проблема теперь
ты не сделал как там
Lua:
local clipper = imgui.ImGuiListClipper(#BuyItems)
while clipper:Step() do                       
    for i = clipper.DisplayStart + 1, clipper.DisplayEnd do
        local f = BuyItems[i]
        if imgui.Button(tostring('%s - %s'):format(i,u8(f)), imgui.ImVec2(res.x / 4.3 , res.y / 40)) then
            table.insert(myBuyItems, {f, 1, 10, true})
            jsonSave(json_file_myBuyList, myBuyItems)
        end
    end
end

#Northn

Police Helper «Reborn» — уже ШЕСТЬ лет!
Всефорумный модератор
2,634
2,482
Тебе же ответили в прошлой теме
 
  • Клоун
Реакции: Fott и AdCKuY_DpO4uLa

Slavka Priore

Участник
Автор темы
85
31

#Northn

Police Helper «Reborn» — уже ШЕСТЬ лет!
Всефорумный модератор
2,634
2,482
так я сделал как там, но видешь какая проблема теперь
ты не сделал как там
Lua:
local clipper = imgui.ImGuiListClipper(#BuyItems)
while clipper:Step() do                       
    for i = clipper.DisplayStart + 1, clipper.DisplayEnd do
        local f = BuyItems[i]
        if imgui.Button(tostring('%s - %s'):format(i,u8(f)), imgui.ImVec2(res.x / 4.3 , res.y / 40)) then
            table.insert(myBuyItems, {f, 1, 10, true})
            jsonSave(json_file_myBuyList, myBuyItems)
        end
    end
end