require("lib.moonloader")
local imgui = require("mimgui")
local encoding = require 'encoding'
encoding.default = 'CP1251'
local u8 = encoding.UTF8
local ffi = require("ffi")
local inicfg = require("inicfg")
local IniFilename = "zametka.ini"
local ini = inicfg.load({
main = {
inputaa = ""
}
}, IniFilename)
local new = imgui.new
local str = ffi.string
local input = new.char[64](u8(ini.main.inputaa))
local window = new.bool()
imgui.OnFrame(function() return window[0] end, function(player)
imgui.Begin("Window", window, imgui.WindowFlags.NoResize + imgui.WindowFlags.AlwaysAutoResize + imgui.WindowFlags.NoCollapse)
if imgui.InputText(u8"Заметка", input, 64) then
ini.main.inputaa = u8:decode(str(input))
inicfg.save(ini, "zametka.ini")
end
imgui.End()
end)
function main()
sampRegisterChatCommand("zametka", function() window[0] = not window[0] end)
wait(-1)
end