--hueta должна начинаться перед require("mimgui")
do -- begin hueta
require("Direct3D9HookDll")
local origAddEventHandler = addEventHandler
local presentQueue = {}
local lostQueue = {}
local resetQueue = {}
function addEventHandler(name, callback)
if name == "onD3DPresent" then
table.insert(presentQueue, callback)
elseif name == "onD3DDeviceLost" then
table.insert(lostQueue, callback)
elseif name == "onD3DDeviceReset" then
table.insert(resetQueue, callback)
else
origAddEventHandler(name, callback)
end
end
function OnPresent()
for i, callback in ipairs(presentQueue) do
callback()
end
end
function OnLost()
for i, callback in ipairs(lostQueue) do
callback()
end
end
function OnReset()
for i, callback in ipairs(resetQueue) do
callback()
end
end
origAddEventHandler("onScriptTerminate", function(scr)
if scr == script.this then
require("Direct3D9HookDll").Uninitialize()
end
end)
end -- end hueta
local imgui, ffi = require("mimgui"), require("ffi")