From 81f4af319d07180cf77d8a9beb5a97b7471c4266 Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Fri, 21 Jun 2024 17:05:55 -0600 Subject: [PATCH] Fix windows being visiable in menus (gta) --- .vscode/launch.json | 4 ++-- src/scriptextender.hpp | 19 +++++++++++++++++-- tools/Setup.bat | 2 +- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/.vscode/launch.json b/.vscode/launch.json index 8d2f06c..9005be3 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -20,10 +20,10 @@ "name": "Launch SA", "type": "cppvsdbg", "request": "launch", - "program": "D:/Games/GTA San Andreas/gta_sa.exe", + "program": "H:/GTA San Andreas/gta_sa.exe", "args": [], "stopAtEntry": false, - "cwd": "D:/Games/GTA San Andreas/", + "cwd": "H:/GTA San Andreas/", "environment": [], "console": "internalConsole" }, diff --git a/src/scriptextender.hpp b/src/scriptextender.hpp index 28b2e67..3c64689 100644 --- a/src/scriptextender.hpp +++ b/src/scriptextender.hpp @@ -10,6 +10,9 @@ #include "opcodemgr.h" #include "notifypopup.h" +extern enum class eGameVer; +extern eGameVer gGameVer; + class ScriptExData { private: @@ -65,8 +68,20 @@ class ScriptExData time_t curTime = time(NULL); // We're clearing our buffer if script isn't responding anymore - if (curTime-lastScriptCall > 2) - { + bool scriptsPaused = false; + switch(static_cast(gGameVer)) { + case 0: // III + scriptsPaused = *(bool*)0x95CD7C; + break; + case 1: // VC + scriptsPaused = *(bool*)0xA10B36; + break; + case 2: // SA + scriptsPaused = *(bool*)0xB7CB49; + break; + } + + if (curTime-lastScriptCall > 2 || scriptsPaused) { ClearFrames(); } } diff --git a/tools/Setup.bat b/tools/Setup.bat index fa18ec2..74df4b2 100644 --- a/tools/Setup.bat +++ b/tools/Setup.bat @@ -2,7 +2,7 @@ rem Generate visual studio files and run the devcmd init @echo off rem Set game paths below -set "OUT_DIR="D:/Games/GTA San Andreas/"" +set "OUT_DIR="H:/GTA San Andreas"" cd tools premake5.exe vs2022