|
local imgui = require 'mimgui' |
|
local vkeys = require 'vkeys' |
|
|
|
local wm = require 'windows.message' |
|
local new = imgui.new |
|
|
|
local renderWindow = new.bool() |
|
local sizeX, sizeY = getScreenResolution() |
|
|
|
imgui.OnInitialize(function() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
imgui.GetIO().IniFilename = nil |
|
end) |
|
|
|
local newFrame = imgui.OnFrame( |
|
function() return renderWindow[0] end, |
|
function(player) |
|
imgui.SetNextWindowPos(imgui.ImVec2(sizeX / 2, sizeY / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5)) |
|
imgui.SetNextWindowSize(imgui.ImVec2(200, 150), imgui.Cond.FirstUseEver) |
|
imgui.Begin("Main Window", renderWindow) |
|
imgui.Text("Hello") |
|
imgui.Text(string.format("Current render mode: %s", renderWindow[0])) |
|
imgui.End() |
|
end |
|
) |
|
|
|
function main() |
|
addEventHandler('onWindowMessage', function(msg, wparam, lparam) |
|
if msg == wm.WM_KEYDOWN or msg == wm.WM_SYSKEYDOWN then |
|
if wparam == vkeys.VK_X then |
|
renderWindow[0] = not renderWindow[0] |
|
end |
|
end |
|
end) |
|
wait(-1) |
|
end |