Add controller fixes for vc too

This commit is contained in:
Grinch_ 2021-10-03 20:04:04 +06:00
parent 1fedaadc04
commit 60d2d90c46
2 changed files with 16 additions and 12 deletions

View File

@ -6,10 +6,10 @@
"${workspaceFolder}/**", "${workspaceFolder}/**",
"${PLUGIN_SDK_DIR}/*", "${PLUGIN_SDK_DIR}/*",
"${DIRECTX9_SDK_DIR}/Include/*", "${DIRECTX9_SDK_DIR}/Include/*",
"${PLUGIN_SDK_DIR}/plugin_sa/*", // "${PLUGIN_SDK_DIR}/plugin_sa/*",
"${PLUGIN_SDK_DIR}/plugin_sa/game_sa/*", // "${PLUGIN_SDK_DIR}/plugin_sa/game_sa/*",
// "${PLUGIN_SDK_DIR}/plugin_vc/*", "${PLUGIN_SDK_DIR}/plugin_vc/*",
// "${PLUGIN_SDK_DIR}/plugin_vc/game_vc/*", "${PLUGIN_SDK_DIR}/plugin_vc/game_vc/*",
"${PLUGIN_SDK_DIR}/shared/*", "${PLUGIN_SDK_DIR}/shared/*",
"${PLUGIN_SDK_DIR}/shared/game/*", "${PLUGIN_SDK_DIR}/shared/game/*",
"C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt\\*", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt\\*",
@ -20,7 +20,7 @@
"IS_PLATFORM_WIN", "IS_PLATFORM_WIN",
"_CRT_SECURE_NO_WARNINGS", "_CRT_SECURE_NO_WARNINGS",
"_CRT_NON_CONFORMING_SWPRINTFS", "_CRT_NON_CONFORMING_SWPRINTFS",
"GTASA", "GTAVC",
"_DX9_SDK_INSTALLED", "_DX9_SDK_INSTALLED",
"PLUGIN_SGV_10US" "PLUGIN_SGV_10US"
], ],

View File

@ -158,27 +158,31 @@ void Hook::ShowMouse(bool state)
{ {
// Disable player controls for controllers // Disable player controls for controllers
#if GTASA
bool bMouseDisabled = false; bool bMouseDisabled = false;
if (patch::Get<BYTE>(BY_GAME(0xBA6818, 0x86968B)) && (m_bShowMouse || bMouseDisabled))
if (patch::Get<BYTE>(0xBA6818) && (m_bShowMouse || bMouseDisabled))
{ {
#ifdef GTASA
CPlayerPed *player = FindPlayerPed(); CPlayerPed *player = FindPlayerPed();
if (player && player->GetPadFromPlayer()) CPad *pad = player ? player->GetPadFromPlayer() : NULL;
#elif GTAVC
CPad *pad = CPad::GetPad(0);
#endif
if (pad)
{ {
if (m_bShowMouse) if (m_bShowMouse)
{ {
bMouseDisabled = true; bMouseDisabled = true;
player->GetPadFromPlayer()->DisablePlayerControls = true; pad->DisablePlayerControls = true;
} }
else else
{ {
bMouseDisabled = false; bMouseDisabled = false;
player->GetPadFromPlayer()->DisablePlayerControls = false; pad->DisablePlayerControls = false;
} }
} }
} }
#endif
if (m_bMouseVisibility != m_bShowMouse) if (m_bMouseVisibility != m_bShowMouse)
{ {