Совместимость двух функций имгуи

Kegwineye.

Участник
Автор темы
478
20
как сделать чтобы сидя в авто при сочетании клавиш л.алт и пкм открывалось сья чудо природы?

Lua:
Lua:

local pie = require 'imgui_piemenu'



if imgui.IsWindowHovered() and imgui.IsMouseClicked(1) then

  imgui.OpenPopup('PieMenu')

end

if pie.BeginPiePopup('PieMenu', 1) then

  if pie.PieMenuItem('Test1') then end

if pie.PieMenuItem('Test2') then end

  —if pie.PieMenuItem('Test5') then end

  if pie.PieMenuItem('Test3', false) then end

  if pie.BeginPieMenu('Sub') then

    if pie.BeginPieMenu('Sub sub\nmenu') then

      if pie.PieMenuItem('SubSub') then end

      if pie.PieMenuItem('SubSub2') then end

      pie.EndPieMenu()

    end

    if pie.PieMenuItem('TestSub') then end

    if pie.PieMenuItem('TestSub2') then end

   pie.EndPieMenu()

  end

  pie.EndPiePopup()

end
 
Решение
Lua:
require "lib.moonloader"
require 'lib.vkeys'
local pie = require 'imgui_piemenu'
local imgui = require 'imgui'
local window = imgui.ImBool(true)
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local pie_mode = imgui.ImBool(false)
local act = false
function main()
  
    while true do wait(0)
        if isKeyDown(VK_MENU) and isKeyJustPressed(VK_RBUTTON) and isCharInAnyCar(PLAYER_PED) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            pie_mode.v = not pie_mode.v
            act = true
            
        end
        imgui.Process = pie_mode.v
    end
end

function imgui.OnDrawFrame()
    if act then...

qdIbp

Автор темы
Проверенный
1,387
1,143
Lua:
require "lib.moonloader"
require 'lib.vkeys'
local pie = require 'imgui_piemenu'
local imgui = require 'imgui'
local window = imgui.ImBool(true)
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8

local pie_mode = imgui.ImBool(false)
local act = false
function main()
  
    while true do wait(0)
        if isKeyDown(VK_MENU) and isKeyJustPressed(VK_RBUTTON) and isCharInAnyCar(PLAYER_PED) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            pie_mode.v = not pie_mode.v
            act = true
            
        end
        imgui.Process = pie_mode.v
    end
end

function imgui.OnDrawFrame()
    if act then imgui.OpenPopup('PieMenu') act = false end
    if pie_mode.v then
        if pie.BeginPiePopup('PieMenu', 1) then
          if pie.PieMenuItem('Test1') then end
        if pie.PieMenuItem('Test2') then end
          
          if pie.PieMenuItem('Test3', false) then end
          if pie.BeginPieMenu('Sub') then
            if pie.BeginPieMenu('Sub sub\nmenu') then
              if pie.PieMenuItem('SubSub') then end
              if pie.PieMenuItem('SubSub2') then end
              pie.EndPieMenu()
            end
            if pie.PieMenuItem('TestSub') then end
            if pie.PieMenuItem('TestSub2') then end
           pie.EndPieMenu()
          end
          pie.EndPiePopup()
        end
    end
end
С "командой" зажимкой клавиш поиграйся, не то я мог как то не правильно написать
 
  • Нравится
Реакции: Kegwineye.