local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local oneWindow, twoWindow = imgui.new.bool(false), imgui.new.bool(false)
imgui.OnInitialize(function() imgui.GetIO().IniFilename = nil end)
local oneFrame = imgui.OnFrame(
function() return oneWindow[0] end,
function(player)
local resX, resY = getScreenResolution()
local sizeX, sizeY = 300, 300
imgui.SetNextWindowPos(imgui.ImVec2(resX / 2, resY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
imgui.Begin('One Window', oneFrame)
imgui.Text('This is one window')
-- WINDOW CODE
imgui.End()
end
)
local twoFrame = imgui.OnFrame(
function() return twoWindow[0] end,
function(player)
if not oneWindow[0] then player.HideCursor = true end
local resX, resY = getScreenResolution()
local sizeX, sizeY = 300, 300
imgui.SetNextWindowPos(imgui.ImVec2(resX / 2, resY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5))
imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
imgui.Begin('Two Window', renderWindow)
imgui.Text('This is two window and hidden cursor')
-- WINDOW CODE
imgui.End()
end
)
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('m1', function()
oneWindow[0] = not oneWindow[0]
end)
sampRegisterChatCommand('m1', function()
twoWindow[0] = not twoWindow[0]
end)
while true do wait(0) end
end