require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
encoding.default = 'cp1251'
local u8 = encoding.UTF8
local cp = encoding.cp1251
local menu = {true,
false,
false,
}
main_window_state = imgui.ImBool(false)
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('test', cmd_openwind)
imgui.Process = false
while true do wait(0)
end
end
function uu()
for i = 0,3 do
menu[i] = false
end
end
function imgui.OnDrawFrame()
if not main_window_state.v then
imgui.Process = false
end
if main_window_state.v then
local sw, sh = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(sw / 2, sh / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(222, 195), imgui.Cond.FirstUseEver)
imgui.Begin('NameScript', main_window_state, imgui.WindowFlags.NoResize + imgui.WindowFlags.NoCollapse)
imgui.Columns(2, "nnn", true, imgui.SetCursorPos(imgui.ImVec2(5, 25)))
imgui.SetColumnWidth(-1,58)
imgui.BeginChild("oknodlyaknopok", imgui.ImVec2(50, 155), true, imgui.WindowFlags.NoScrollbar)
if imgui.Button(u8'Окно1', imgui.SetCursorPos(imgui.ImVec2(5, 7))) then
uu() menu[1] = true
end
if imgui.Button(u8'Окно2', imgui.SetCursorPos(imgui.ImVec2(5, 32))) then
uu() menu[2] = true
end
if imgui.Button(u8'Окно3', imgui.SetCursorPos(imgui.ImVec2(5, 57))) then
uu() menu[3] = true
end
imgui.EndChild()
imgui.NextColumn()
if menu[1] then
imgui.Text(u8'1 меню')
end
if menu[2] then
imgui.Text(u8'2 меню')
end
if menu[3] then
imgui.Text(u8'3 меню')
end
imgui.End()
end
end
function cmd_openwind(arg)
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end