1
0
mirror of synced 2025-02-20 20:41:34 +01:00

Remove hardcoded exit keys in games, global will cover all

This commit is contained in:
Aaron M 2021-09-17 16:39:06 +12:00
parent a3b3617078
commit 4a397557e1
11 changed files with 3 additions and 100 deletions

View File

@ -857,20 +857,6 @@ DWORD WINAPI InputRT9(LPVOID lpParam)
}
}
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
HWND hWndTMP = GetForegroundWindow();
if (hWndRT9 == 0)
{
hWndRT9 = FindWindowW(NULL, TEXT("Dirty Drivin'"));
}
if (hWndTMP == hWndRT9)
{
exit(0);
}
}
if (!ToBool(config["General"]["Free Play"]))
{
CoinInput(0);

View File

@ -103,12 +103,6 @@ DWORD WINAPI InputRT3(LPVOID lpParam)
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
exit(0);
}
// buttons see bitwise values in TPui//RawThrills.cs
// START
if (*ffbOffset & 0x08)

View File

@ -41,11 +41,6 @@ DWORD WINAPI InputRT(LPVOID lpParam)
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
exit(0);
}
// buttons see bitwise values in TPui//RawThrills.cs
// START
if (*ffbOffset & 0x08)

View File

@ -104,12 +104,6 @@ DWORD WINAPI InputRT4(LPVOID lpParam)
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
exit(0);
}
// buttons see bitwise values in TPui//RawThrills.cs
// START
if (*ffbOffset & 0x08)

View File

@ -44,11 +44,6 @@ DWORD WINAPI InputRT2(LPVOID lpParam)
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
exit(0);
}
// buttons see bitwise values in TPui//RawThrills.cs
// START ( = NITRO too)
if (*ffbOffset & 0x08)

View File

@ -57,20 +57,6 @@ DWORD WINAPI InputRT5(LPVOID lpParam)
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
HWND hWndTMP = GetForegroundWindow();
if (hWndRT5 == 0)
{
hWndRT5 = FindWindowA(NULL, "FNF SuperBikes 2");
}
if (hWndTMP == hWndRT5)
{
exit(0);
}
}
if (GetAsyncKeyState(VK_NUMPAD1) & 0x0001)
{
if (NUMpressed1 == false)

View File

@ -52,22 +52,6 @@ BOOL(__stdcall *original_SetCursorPosRT6)(int X, int Y);
BOOL(__stdcall *original_SetWindowTextWRT6)(HWND hWnd, LPCWSTR lpString);
BOOL(__stdcall *original_XInputGetStateGHA)(DWORD dwUserIndex, XINPUT_STATE* pState);
DWORD WINAPI InputRT6(LPVOID lpParam)
{
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
WinExec("taskkill /f /im GHA.exe", SW_HIDE);
}
//DEBUG//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//info(true, "test values *ffbOffset3=0x%02X / *ffbOffset4=0x%02X ", *ffbOffset3, *ffbOffset4);
//DEBUG//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
}
return 0;
}
DWORD WINAPI WindowRT6(LPVOID lpParam)
{
while (true)
@ -494,8 +478,6 @@ static InitFunction GHAFunc([]()
Sleep(100);
}
CreateThread(NULL, 0, InputRT6, NULL, 0, NULL);
MH_Initialize();
MH_CreateHookApi(L"user32.dll", "SetWindowPos", &SetWindowPosRT6, (void**)&original_SetWindowPos6);
MH_CreateHookApi(L"user32.dll", "SetWindowTextW", &SetWindowTextWRT6, (void**)&original_SetWindowTextWRT6);

View File

@ -50,12 +50,6 @@ DWORD WINAPI InputRT10(LPVOID lpParam)
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
exit(0);
}
// FIX FOR NAME CHOOSING
if (strcmp((char*)0x3CB4F8 + BaseAddress10, EnterYourName) == 0 || strcmp((char*)0x3CB4FE + BaseAddress10, HighScoreName) == 0 || strcmp((char*)0x3CB4FF + BaseAddress10, HighScoreName) == 0)
NameChoosing = true;

View File

@ -47,20 +47,6 @@ DWORD WINAPI InputRT8(LPVOID lpParam)
while (true)
{
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
HWND hWndTMP = GetForegroundWindow();
if (hWndRT8 == 0)
{
hWndRT8 = FindWindowA(NULL, "Justice League");
}
if (hWndTMP == hWndRT8)
{
exit(0);
}
}
// regular buttons are emulated by XINPUTEMU
// TEST
if (*ffbOffset & 0x01)

View File

@ -269,16 +269,6 @@ __int64 UIO_AMIC_Update(__int64 a1)
// auto result = g_origUIO_AMIC_Update(a1);
// info(true, "UIO_AMIC_Update result: %08X", result);
// ESCAPE QUITS GAME
if (GetAsyncKeyState(VK_ESCAPE) & 0x8000)
{
HWND hWndTmp = GetForegroundWindow();
if ((hWndTmp == FindWindowA(NULL, "StreetFighterV")))
{
exit(0);
}
}
BYTE ButtonStateByte1 = 0;
BYTE ButtonStateByte2 = 0;
BYTE ButtonStateByte3 = 7;

View File

@ -69,9 +69,10 @@ std::wstring utf8_decode(const std::string &str)
static void QuitGame()
{
if (GameDetect::currentGame == GameID::Daytona3)
{
system("taskkill /f /im InpWrapper.exe");
}
if (GameDetect::currentGame == GameID::GHA)
system("taskkill /f /im GHA.exe"); // is this necessary?
if ((GameDetect::currentGame == GameID::StarWarsEs3X) || (GameDetect::currentGame == GameID::StarWarsJapEs3X) || (GameDetect::currentGame == GameID::StarWarsEs3XLauncher) || (GameDetect::currentGame == GameID::StarWarsJapEs3XLauncher))
{