- 478
- 20
Lua:
local imgui = require('imgui')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local keys = require 'rkeys'
local vk = require 'vkeys'
local window = imgui.ImBool(false)
function main()
while not isSampAvailable() do wait(200) end
sampRegisterChatCommand('ghelper', openwindow)
if isKeyDown(VK_ALT) and isKeyJustPressed(VK_Y) then
imgui.ShowCursor = not imgui.ShowCursor
end
imgui.Process = false
window.v = true
--show window on start
while true do
wait(0)
imgui.Process = window.v
end
end
function openwindow()
window.v = not window.v
end
function imgui.OnDrawFrame()
if window.v then
local resX, resY = getScreenResolution()
local sizeX, sizeY = 60, 100 -- WINDOW SIZE
imgui.SetNextWindowPos(imgui.ImVec2(resX / 1.05 - sizeX / 2, resY / 2 - sizeY / 2), imgui.Cond.FirstUseEver)
imgui.SetNextWindowSize(imgui.ImVec2(sizeX, sizeY), imgui.Cond.FirstUseEver)
imgui.Begin('Window Title', window)
--window code
imgui.End()
end
end
как сделать, чтобы изначально не было курсора, а при нажатии АЛЬТ + Y он появлялся/исчеказ?
@chapo @ARMOR @Rice.
Последнее редактирование: