- 75
- 18
- Версия MoonLoader
- .026-beta
как сохронить кфг через imgui.Button()?
Говнокод:
local imgui = require 'imgui'
local key = require 'vkeys'
local ini = require 'inicfg'
local encoding = require 'encoding'
encoding.default = 'CP1251'
u8 = encoding.UTF8
local test_text_buffer = imgui.ImBuffer(800)
local main_window_state = imgui.ImBool(false)
function imgui.OnDrawFrame()
if main_window_state.v then
imgui.SetNextWindowSize(imgui.ImVec2(250, 400), imgui.Cond.FirstUseEver)
imgui.Begin(u8"Шпоргалка", main_window_state)
imgui.InputTextMultiline(u8"Шпоргалка", test_text_buffer)
if imgui.Button("Save") then
end
imgui.End()
end
end
function main()
sampRegisterChatCommand("shpora", function()
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end)
end