ImGui

masiiksmasik3134

Участник
Автор темы
33
2
Версия MoonLoader
Другое
Кароче, почему-то 3-тье не работает. Менял их со 2-рым, но 3-тье место так-же не работает. Если кто-то не понял - в комменты отпишу
Lua:
local imgui = require "imgui"
local key = require "vkeys"
local encoding = require "encoding"
encoding.default = "CP1251"
u8 = encoding.UTF8
local main_window_state = imgui.ImBool(false)
local secondary_window_state = imgui.ImBool(false)
local efir_window_state = imgui.ImBool(false)
local pomosh_window_state = imgui.ImBool(false)

local sw, sh = getScreenResolution()

local themes = import "Eternity\\imgui_themes.lua"

function main()
    while not isSampAvailable() do wait(100) end
    sampAddChatMessage("{32CD32}[Admins Tool] Empire Загружен", -1)
    imgui.SwitchContext()
    themes.SwitchColorTheme(6)
                imgui.Process = false
    while true do
        wait(0)
        if wasKeyPressed(key.VK_X) then
            main_window_state.v = not main_window_state.v
            imgui.Process = main_window_state.v
            end
        end
end


function imgui.OnDrawFrame()
     if not main_window_state.v and not secondary_window_state.v and not efir_window_state.v and not pomosh_window_state.v then
          imgui.Process = false
       end
    if main_window_state.v then
        imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
        imgui.SetNextWindowSize(imgui.ImVec2(385, 500), imgui.Cond.FirstUseEver)
        imgui.Begin("Admin Helper by MacBrown", main_window_state, imgui.WindowFlags.NoResize)
        img = imgui.CreateTextureFromFile(getGameDirectory() .. "\\moonloader\\Eternity\\76.png")
        imgui.Image(img, imgui.ImVec2(400, 200))
        imgui.SetCursorPosX((imgui.GetWindowWidth() - 75 + imgui.GetStyle().ItemSpacing.x) / 2)
        imgui.Text(u8"Типы:")
        imgui.SetCursorPosX((imgui.GetWindowWidth() - 215 + imgui.GetStyle().ItemSpacing.x) / 2)
        if imgui.Button(u8"Реклама", imgui.ImVec2(200, 25)) then
            secondary_window_state.v = not secondary_window_state.v
            main_window_state.v = not main_window_state.v
            end
            
            imgui.SetCursorPosX((imgui.GetWindowWidth() - 215 + imgui.GetStyle().ItemSpacing.x) / 2)
            if imgui.Button(u8"Эфиры", imgui.ImVec2(200, 25)) then
                efir_window_state.v = not efir_window_state.v
                main_window_state.v = not main_window_state.v
            
                imgui.SetCursorPosX((imgui.GetWindowWidth() - 215 + imgui.GetStyle().ItemSpacing.x) / 2)
                if imgui.Button(u8"Помогаем Игрокам", imgui.ImVec2(200, 25)) then
                    pomosh_window_state.v = not pomosh_window_state.v
                    main_window_state.v = not main_window_state.v
            end
        end
        imgui.End()
  end
  ----------------------------
    if secondary_window_state.v then

       imgui.SetNextWindowSize(imgui.ImVec2(820, 250), imgui.Cond.FirstUseEver)
       imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2),  imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
      

     imgui.Begin("Info", secondary_window_state)
     imgui.End()
 end
 ---------------
    if efir_window_state.v then
        imgui.SetNextWindowSize(imgui.ImVec2(820, 250), imgui.Cond.FirstUseEver)
        imgui.SetNextWindowPos(imgui.ImVec2((sw / 2), sh / 2),  imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
    
     imgui.Begin("Info", efir_window_state)
     if imgui.Button("Click") then
        os.execute("start https://vk.com/@osap.fott-eventbot")
        end
     imgui.End()
    end
end
 
Решение
Ты вторую кнопку на закрыл, а уже создаешь новую
1590944576249.png

Lua:
    if imgui.Button(u8"Эфиры", imgui.ImVec2(200, 25)) then
                efir_window_state.v = not efir_window_state.v
                main_window_state.v = not main_window_state.v
            end

                --imgui.SetCursorPosX((imgui.GetWindowWidth() - 215 + imgui.GetStyle().ItemSpacing.x) / 2)
                if imgui.Button(u8"Помогаем Игрокам", imgui.ImVec2(200, 25)) then
                    pomosh_window_state.v = not pomosh_window_state.v
                    main_window_state.v = not main_window_state.v
            end

Fott

Простреленный
3,433
2,279
Ты вторую кнопку на закрыл, а уже создаешь новую
1590944576249.png

Lua:
    if imgui.Button(u8"Эфиры", imgui.ImVec2(200, 25)) then
                efir_window_state.v = not efir_window_state.v
                main_window_state.v = not main_window_state.v
            end

                --imgui.SetCursorPosX((imgui.GetWindowWidth() - 215 + imgui.GetStyle().ItemSpacing.x) / 2)
                if imgui.Button(u8"Помогаем Игрокам", imgui.ImVec2(200, 25)) then
                    pomosh_window_state.v = not pomosh_window_state.v
                    main_window_state.v = not main_window_state.v
            end
 
  • Нравится
Реакции: masiiksmasik3134