From 31ed05dfb43cd61059ab6992b875be12e48b0b2c Mon Sep 17 00:00:00 2001 From: Linventif Date: Wed, 24 Jan 2024 01:27:10 +0100 Subject: [PATCH] cancel modification --- lua/gmod_integration/client/cl_main.lua | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/lua/gmod_integration/client/cl_main.lua b/lua/gmod_integration/client/cl_main.lua index 687aad9..aea0a93 100644 --- a/lua/gmod_integration/client/cl_main.lua +++ b/lua/gmod_integration/client/cl_main.lua @@ -34,17 +34,11 @@ function gmInte.openAdminConfig() end local ScreenshotRequested = false -local frameCount = 0 - hook.Add("PostRender", "gmInteScreenshot", function() - if (!ScreenshotRequested) then return end + if (!ScreenshotRequested) then return end + ScreenshotRequested = false - frameCount = frameCount + 1 - if (frameCount < 2) then return end - - ScreenshotRequested = false - - local captureData = { + local captureData = { format = "png", x = 0, y = 0, @@ -76,8 +70,9 @@ function gmInte.takeScreenShot(serverID, authToken) gmInte.config.id = serverID gmInte.config.token = authToken - ScreenshotRequested = true - frameCount = 0 + timer.Simple(0.2, function() + ScreenshotRequested = true + end) end //