pie menu багается

Lance_Sterling

Известный
Автор темы
801
282
Версия MoonLoader
.026-beta
ку, крч когда я хочу поставить любую клавишу, будь то мышка(КРОМЕ ПКМ) или клавиатура в активацию pie menu, случаются баги:
если отпускаю клавишу, не закрывается меню
если оставил курсор на любой ячейке с действием, действие не будет проиграно

если сделать ПКМ(как указано в примере, в pie то все ок и все чики пуки)
кусок кода:
Lua:
local piemenu = imgui.ImBool(true)
function main()
    if not isSampLoaded() then return end
    if not isSampfuncsLoaded() then return end
    repeat wait(100) until isSampAvailable()--проверяем загружен ли самп
    AddChatMessage('Загружен!', 1)--выводим сообщение в чат при загружен
    sampRegisterChatCommand('phelper', function()
        window.v = not window.v
    end)
    while true do
        wait(0)
        imgui.Process = true
        imgui.ShowCursor = (piemenu.v and imgui.IsKeyDown(VK_G) and mainIni.settings.enable_pie)
    end
end



function imgui.OnDrawFrame()
    if not piemenu.v and not window.v then
        imgui.Process = false
    end
    if piemenu.v and not window.v and mainIni.settings.enable_pie then
        if imgui.IsKeyPressed(VK_G) then imgui.OpenPopup('PieMenu') end
        if pie.BeginPiePopup('PieMenu', 1) then
            for k, v in ipairs(pie_elements) do
                if v.next == nil then if pie.PieMenuItem(u8(v.name)) then v.action() end
                elseif type(v.next) == 'table' then drawPieSub(v) end
            end
            pie.EndPiePopup()
        end
    end
end
function drawPieSub(v)
    lua_thread.create(function()
        if pie.BeginPieMenu(u8(v.name)) then
          for i, l in ipairs(v.next) do
            if l.next == nil then
              if pie.PieMenuItem(u8(l.name)) then l.action() end
            elseif type(l.next) == 'table' then
              drawPieSub(l)
            end
          end
          pie.EndPieMenu()
        end
    end)
end