Вопрос по имгуи

Kegwineye.

Участник
Автор темы
478
20
Версия MoonLoader
.026-beta
@PanSeek как сделать чтобы сидя в авто при сочетании клавиш л.алт и пкм открывалось сья чудо природы?

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:
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 imgui.Process == false then imgui.ShowCursor = false end
        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 = true
            act = true
          
        end
        imgui.Process = pie_mode.v
    end
end


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

qdIbp

Автор темы
Проверенный
1,387
1,144
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.

Участник
Автор темы
478
20
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
С "командой" зажимкой клавиш поиграйся, не то я мог как то не правильно написать
1638869610585.png
 

Kegwineye.

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

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
        if imgui.Process == false then imgui.ShowCursor = false end
    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 sampAddChatMessage("QQ") then
              pie.EndPieMenu()
            end
            if pie.PieMenuItem('TestSub') then end
            if pie.PieMenuItem('TestSub2') then end
           pie.EndPieMenu()
          end
          pie.EndPiePopup()
        end
    end
end
 

Kegwineye.

Участник
Автор темы
478
20
@qdIbp
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
        if imgui.Process == false then imgui.ShowCursor = false end
    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(u8'Открыть/Закрыть') then if sampAddChatMessage("/lock") then end
        if pie.PieMenuItem(u8'Завести/Заглушить') then if sampAddChatMessage("/engine") then end
          if pie.PieMenuItem(u8'Вкл/Выкл ТТ', false) then if sampAddChatMessage("/style") then end
          if pie.PieMenuItem(u8'Ключи') then if sampAddChatMessage("/key") then end
              pie.EndPieMenu()
                end
            end
          pie.EndPiePopup()
                end
            end
        end
    end
end

1638871395641.png
 

qdIbp

Автор темы
Проверенный
1,387
1,144
Lua:
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 imgui.Process == false then imgui.ShowCursor = false end
        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 = true
            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') then
            if pie.PieMenuItem(u8'Открыть/Закрыть') then if sampAddChatMessage("/lock",-1) then end end
            if pie.PieMenuItem(u8'Завести/Заглушить') then if sampAddChatMessage("/engine",-1) then end end
            if pie.PieMenuItem(u8'Вкл/Выкл ТТ') then if sampAddChatMessage("/style",-1) then end end
            if pie.PieMenuItem(u8'Ключи') then if sampAddChatMessage("/key",-1)then end end
        pie.EndPiePopup()
        end
    end
end

Крашил из за лишнего
Lua:
pie.EndPiePopup()
потому что ты удалил один
Lua:
pie.BeginPiePopup('PieMenu')

Ну крч как в обыч imgui
 
  • Нравится
Реакции: Kegwineye.

Kegwineye.

Участник
Автор темы
478
20
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') then
            if pie.PieMenuItem(u8'Открыть/Закрыть') then if sampAddChatMessage("/lock",-1) then end end
            if pie.PieMenuItem(u8'Завести/Заглушить') then if sampAddChatMessage("/engine",-1) then end end
            if pie.PieMenuItem(u8'Вкл/Выкл ТТ') then if sampAddChatMessage("/style",-1) then end end
            if pie.PieMenuItem(u8'Ключи') then if sampAddChatMessage("/key",-1)then end end
        pie.EndPiePopup()
        end
    end
end
на выбор открыть и тд не пишет в чат команду.
Сделай после закритыя чтобы пропадал курсор
 

qdIbp

Автор темы
Проверенный
1,387
1,144
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 not pie_mode.v and not imgui.Process then imgui.ShowCursor = false else imgui.ShowCursor = true  end
        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') then
            if pie.PieMenuItem(u8'Открыть/Закрыть') then if sampAddChatMessage("/lock",-1) then end end
            if pie.PieMenuItem(u8'Завести/Заглушить') then if sampAddChatMessage("/engine",-1) then end end
            if pie.PieMenuItem(u8'Вкл/Выкл ТТ') then if sampAddChatMessage("/style",-1) then end end
            if pie.PieMenuItem(u8'Ключи') then if sampAddChatMessage("/key",-1)then end end
        pie.EndPiePopup()
        end
    end
end
 

qdIbp

Автор темы
Проверенный
1,387
1,144
@qdIbp не работает все равно ни курсор ни вывод текста в чат
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 not act then imgui.ShowCursor = false else imgui.ShowCursor = true  end
        if isKeyDown(VK_MENU) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            pie_mode.v = true
            act = true
        end
        imgui.Process = pie_mode.v
    end
end

function imgui.OnDrawFrame()
    if act then imgui.OpenPopup('PieMenu') end
    if pie_mode.v then
        if pie.BeginPiePopup('PieMenu') then
            if pie.PieMenuItem(u8'Открыть/Закрыть') then print('+9+')sampAddChatMessage("/lock",-1) act = false end
            if pie.PieMenuItem(u8'Завести/Заглушить') then sampAddChatMessage("/engine",-1) act = false end
            if pie.PieMenuItem(u8'Вкл/Выкл ТТ') then sampAddChatMessage("/style",-1) act = false end
            if pie.PieMenuItem(u8'Ключи') then sampAddChatMessage("/key",-1) act = false end
        pie.EndPiePopup()
        end
    end
end
Как насчет такого

Активация просто Alt
 

Kegwineye.

Участник
Автор темы
478
20
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 not act then imgui.ShowCursor = false else imgui.ShowCursor = true  end
        if isKeyDown(VK_MENU) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            pie_mode.v = true
            act = true
        end
        imgui.Process = pie_mode.v
    end
end

function imgui.OnDrawFrame()
    if act then imgui.OpenPopup('PieMenu') end
    if pie_mode.v then
        if pie.BeginPiePopup('PieMenu') then
            if pie.PieMenuItem(u8'Открыть/Закрыть') then print('+9+')sampAddChatMessage("/lock",-1) act = false end
            if pie.PieMenuItem(u8'Завести/Заглушить') then sampAddChatMessage("/engine",-1) act = false end
            if pie.PieMenuItem(u8'Вкл/Выкл ТТ') then sampAddChatMessage("/style",-1) act = false end
            if pie.PieMenuItem(u8'Ключи') then sampAddChatMessage("/key",-1) act = false end
        pie.EndPiePopup()
        end
    end
end
Как насчет такого

Активация просто Alt
pasiba

как сделать правельный импорт fAwesome5 ?

@qdIbp
 

Kegwineye.

Участник
Автор темы
478
20
local fa = require 'fAwesome5'
spspspspsps

@qdIbp чо делать, тут при нажатии альт , выбора функции нажимаю на нее и она один раз нажмется потом еще раз откроется и потом уже выводит текст
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 not act then imgui.ShowCursor = false else imgui.ShowCursor = true  end
        if isKeyDown(VK_MENU) and not sampIsChatInputActive() and not sampIsDialogActive() and not isPauseMenuActive() and not isSampfuncsConsoleActive() then
            pie_mode.v = true
            act = true
        end
        imgui.Process = pie_mode.v
    end
end

function imgui.OnDrawFrame()
    if act then imgui.OpenPopup('PieMenu') end
    if pie_mode.v then
        if pie.BeginPiePopup('PieMenu') then
            if pie.PieMenuItem(u8'Открыть/Закрыть') then print('+9+')sampAddChatMessage("/lock",-1) act = false end
            if pie.PieMenuItem(u8'Завести/Заглушить') then sampAddChatMessage("/engine",-1) act = false end
            if pie.PieMenuItem(u8'Вкл/Выкл ТТ') then sampAddChatMessage("/style",-1) act = false end
            if pie.PieMenuItem(u8'Ключи') then sampAddChatMessage("/key",-1) act = false end
        pie.EndPiePopup()
        end
    end
end
Как насчет такого

Активация просто Alt
 
Последнее редактирование: