Имгуи окно

anklain

Участник
Автор темы
82
4
Версия MoonLoader
.027.0-preview
Не получается закрыть окно имгуи после добавления setwindowsize, помогите пжлст
Code:
Lua::
local main_color = 0xFFFFFF
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"
local red_color = "{FF0000}"
local imgui = require 'imgui'

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

local sw, sh = getScreenResolution()

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
      while not isSampAvailable() do wait(100) end
      sampAddChatMessage("" .. tag, main_color)

      sampRegisterChatCommand("casino", cmd_casino)

      imgui.Procces = false

      while true do
      wait(0)

end
end

function cmd_casino(arg)
    main_window_state.v = not main_window_state.v
    imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame()
    if not main_window_state.v then
        imgui.Procces = false
    end

        imgui.SetNextWindowSize(imgui.ImVec2(1000, 500), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))

        imgui.Begin("Bebra", main_window_state, imgui.WindowFlags.NoResize)
        imgui.Text("Bebra")
        imgui.InputText("You love bebra?", text_buffer)
        imgui.End()
end
 

Ne0nD0

Участник
58
0
Не получается закрыть окно имгуи после добавления setwindowsize, помогите пжлст
Code:
Lua::
local main_color = 0xFFFFFF
local main_color_text = "{5A90CE}"
local white_color = "{FFFFFF}"
local red_color = "{FF0000}"
local imgui = require 'imgui'

local main_window_state = imgui.ImBool(false)
local text_buffer = imgui.ImBuffer(256)

local sw, sh = getScreenResolution()

function main()
    if not isSampLoaded() or not isSampfuncsLoaded() then return end
      while not isSampAvailable() do wait(100) end
      sampAddChatMessage("" .. tag, main_color)

      sampRegisterChatCommand("casino", cmd_casino)

      imgui.Procces = false

      while true do
      wait(0)

end
end

function cmd_casino(arg)
    main_window_state.v = not main_window_state.v
    imgui.Process = main_window_state.v
end

function imgui.OnDrawFrame()
    if not main_window_state.v then
        imgui.Procces = false
    end

        imgui.SetNextWindowSize(imgui.ImVec2(1000, 500), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))

        imgui.Begin("Bebra", main_window_state, imgui.WindowFlags.NoResize)
        imgui.Text("Bebra")
        imgui.InputText("You love bebra?", text_buffer)
        imgui.End()
end
lua:
function imgui.OnDrawFrame()
   if main_window_state.v then
    imgui.ShowCursor = true
        imgui.SetNextWindowSize(imgui.ImVec2(1000, 500), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.Begin("Bebra", main_window_state,imgui.WindowFlags.NoResize)
        imgui.Text("Bebra")
        imgui.InputText("You love bebra?", text_buffer)
        imgui.End()
   else
    imgui.ShowCursor = false
   end
end
проверь

lua:
function imgui.OnDrawFrame()
   if main_window_state.v then
    imgui.ShowCursor = true
        imgui.SetNextWindowSize(imgui.ImVec2(1000, 500), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.Begin("Bebra", main_window_state,imgui.WindowFlags.NoResize)
        imgui.Text("Bebra")
        imgui.InputText("You love bebra?", text_buffer)
        imgui.End()
   else
    imgui.ShowCursor = false
   end
end
проверь
showcursor не обязательно) это я так для удобства написал
 
Последнее редактирование: