local ffi = require('ffi');
local imgui = require('mimgui');
local encoding = require('encoding');
encoding.default = 'CP1251';
local u8 = encoding.UTF8;
local window = imgui.new.bool(false);
local active = imgui.new.bool(false);
local text = imgui.new.char[64]('Hello world!');
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil;
end)
imgui.OnFrame(
function() return window[0] end,
function(this)
local size, res = imgui.ImVec2(780, 1000), imgui.ImVec2(getScreenResolution());
imgui.SetNextWindowPos(imgui.ImVec2(res.x / 2, res.y / 2), imgui.Cond.FirstUseEver, imgui.ImVec2(0.5, 0.5));
imgui.SetNextWindowSize(size, imgui.Cond.FirstUseEver);
if imgui.Begin('test window', window, imgui.WindowFlags.NoCollapse) then
imgui.InputText(u8'', text, ffi.sizeof(text));
if (imgui.Button(u8'1', imgui.ImVec2(507,40))) then
sampAddChatMessage('text' ..text)
end
imgui.End();
end
end
)
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('debil', function()
window[0] = not window[0]
end)
wait(-1)
end