require "lib.moonloader"
local imgui = require 'imgui'
local main_window_state = imgui.ImBool(false)
function main()
if not isSampfuncsLoaded() or not isSampLoaded() then return end
while not isSampAvailable() do wait(100) end
sampAddChatMessage("Test scripts LOADED", -1)
sampRegisterChatCommand("test", test)
imgui.Process = false
while true do
wait(0)
end
end
function test()
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end
function imgui.OnDrawFrame()
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(800, 350), imgui.Cond.FirstUseEver)
local sW, sH = getScreenResolution()
imgui.SetNextWindowPos(imgui.ImVec2(sW / 2, sH / 2), imgui.Cond.ImGuiCond_Always, imgui.ImVec2(0.5, 0.5))
imgui.Begin("Test",main_window_state, imgui.WindowFlags.NoResize)
imgui.BeginChild('left pane', imgui.ImVec2(150, 0), true)
if imgui.Button("Button 1", imgui.ImVec2(145, 20)) then
end
if imgui.Button("Button 2", imgui.ImVec2(145, 20)) then
end
imgui.EndChild()
imgui.SameLine(165)
imgui.BeginChild('Central UP', imgui.ImVec2(630, 100), true)
imgui.Text("Some Text1")
imgui.Text("Some Text2")
imgui.EndChild()
imgui.SetCursorPos(imgui.ImVec2(165, 140))
imgui.BeginChild('Central Down', imgui.ImVec2(630, 100), true)
imgui.Text("Some Text")
if imgui.Button("Button in Child", imgui.ImVec2(145, 20)) then
end
imgui.EndChild()
imgui.End()
end
end