- 390
- 132
- Версия MoonLoader
- .026-beta
GovnoCode:
local imgui = require 'mimgui'
local encoding = require 'encoding'
local inicfg = require 'inicfg'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local renderWindow = imgui.new.bool(true)
--[[local ads = {
imgui.new.char[128]('')
}]]
IniFilename = 'Testoviy.ini'
local cfg = inicfg.load({
imgui.new.char[128]('')
}, IniFilename)
imgui.OnInitialize(function()
imgui.GetIO().IniFilename = nil
end)
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.Button('+')) then
table.insert(cfg, imgui.new.char[128](''));
inicfg.save(cfg, IniFilename)
end
if (imgui.Button('-')) then
table.remove(cfg);
inicfg.save(cfg, IniFilename)
end
for index, buffer in ipairs(cfg) do
-- input
imgui.InputText(u8"Ваш текст", buffer, 256)
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