Skip to content

Commit

Permalink
Fix windows being visiable in menus (gta)
Browse files Browse the repository at this point in the history
  • Loading branch information
user-grinch committed Jun 21, 2024
1 parent d6d3cf2 commit 81f4af3
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down
19 changes: 17 additions & 2 deletions src/scriptextender.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include "opcodemgr.h"
#include "notifypopup.h"

extern enum class eGameVer;
extern eGameVer gGameVer;

class ScriptExData
{
private:
Expand Down Expand Up @@ -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<int>(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();
}
}
Expand Down
2 changes: 1 addition & 1 deletion tools/Setup.bat
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 81f4af3

Please sign in to comment.