- 211
- 12
- Версия MoonLoader
- .027.0-preview
в чём оишибка должно выводить текст в имгуи из диалога
Lua:
require "lib.moonloader"
local imgui = require 'imgui'
local encoding = require 'encoding'
local inicfg = require 'inicfg'
local samp = require 'samp.events'
local main_color = 0x02274D
local main_color2 = 0x50BD27
local main_color1 = 0xE60020
local main_color3 = 0x138D75
encoding.default = 'CP1251'
u8 = encoding.UTF8
local main_window_state = imgui.ImBool(false)
function main()
if not isSampLoaded() and not isSampfuncsLoaded() then return end
while not isSampAvailable() do wait(100) end
sampRegisterChatCommand('vi', cmd_vi)
while true do
wait(0)
end
end
function samp.onShowDialog(dialogId, style, title, button1, button2, text)
if sampIsDialogActive() then
diaId = sampGetCurrentDialogId()
end
local result, _, _, diaText = sampHasDialogRespond(diaId)
end
-- end
-- end
-- end
function cmd_vi()
main_window_state.v = not main_window_state.v
imgui.Process = main_window_state.v
end
function imgui.OnDrawFrame()
if not main_window_state.v then
imgui.Process = false
end
if main_window_state.v then
imgui.Begin('test', main_window_state)
if result then
imgui.Text(diaText)
end
imgui.End()
end
end