local imgui = require 'mimgui'
local ffi = require('ffi')
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local inicfg = require 'inicfg'
local directIni = 'bromo.ini'
local ini = inicfg.load({
main = {
str = '';
},
}, directIni)
inicfg.save(ini, directIni)
local renderWindow = imgui.new.bool(true)
local input = imgui.new.char[64](u8(ini.main.str))
local newFrame = imgui.OnFrame(
function() return renderWindow[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)
if imgui.Begin('Main Window', renderWindow) then
if imgui.InputText(u8'bromo',input,64) then
ini.main.str = u8:decode(ffi.string(input))
inicfg.save(ini,directIni)
end
imgui.SameLine()
if imgui.Button('fgdfgfd') then
sampAddChatMessage(ini.main.str, -1)
end
imgui.End()
end
end
)
function main()
while not isSampAvailable() do wait(0) end
sampRegisterChatCommand('mimgui', function()
renderWindow[0] = not renderWindow[0]
end)
wait(-1)
end