From 068b0fa69184e8b1c367f48efe2ec4595628ea8d Mon Sep 17 00:00:00 2001 From: ThirteenAG Date: Thu, 21 Nov 2024 20:14:38 +0800 Subject: [PATCH] gtasade: camera tweak --- source/GTA3DE.FusionMod/dllmain.cpp | 4 ++-- source/GTASADE.FusionMod/dllmain.cpp | 19 ++++++++++++++++--- source/GTAVCDE.FusionMod/dllmain.cpp | 4 ++-- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/source/GTA3DE.FusionMod/dllmain.cpp b/source/GTA3DE.FusionMod/dllmain.cpp index 970c6f10..5de31c0d 100644 --- a/source/GTA3DE.FusionMod/dllmain.cpp +++ b/source/GTA3DE.FusionMod/dllmain.cpp @@ -42,7 +42,7 @@ namespace UUI_LegalScreen HWND ghWnd; void LockCursor() { - if (ghWnd == GetFocus()) + if (ghWnd == GetForegroundWindow()) { RECT windowRect; POINT pt = { 0, 0 }; @@ -426,7 +426,7 @@ void Init() } } - if (fHudScale != 1.0f || fRadarScale != 1.0f) + //if (fHudScale != 1.0f || fRadarScale != 1.0f) { auto str = utility::scan_string(utility::get_executable(), "%s %f %f %f %f %s %s", true); if (str) diff --git a/source/GTASADE.FusionMod/dllmain.cpp b/source/GTASADE.FusionMod/dllmain.cpp index d39b9e14..cb522ad6 100644 --- a/source/GTASADE.FusionMod/dllmain.cpp +++ b/source/GTASADE.FusionMod/dllmain.cpp @@ -43,7 +43,7 @@ namespace UUI_LegalScreen HWND ghWnd; void LockCursor() { - if (ghWnd == GetFocus()) + if (ghWnd == GetForegroundWindow()) { RECT windowRect; POINT pt = { 0, 0 }; @@ -469,7 +469,7 @@ void Init() } } - if (fHudScale != 1.0f || fRadarScale != 1.0f) + //if (fHudScale != 1.0f || fRadarScale != 1.0f) { auto str = utility::scan_string(utility::get_executable(), "%s %f %f %f %f %s %s", true); if (str) @@ -782,6 +782,20 @@ void Init() }); // y axis delay + pattern = hook::pattern("F3 0F 10 46 ? 0F 57 C9 F3 41 0F 10 CA"); + static auto Alpha = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) + { + if (fTimer <= 0.0f || fabs(fAimWeaponUpDown) > fThreshold) + { + + } + else + { + *(float*)regs.rsi = regs.xmm1.f32[0]; + regs.xmm10.f32[0] = regs.xmm1.f32[0]; + } + }); + pattern = hook::pattern("F3 0F 11 36 F3 44 0F 58 F0"); injector::MakeNOP(pattern.get_first(), 4, true); static auto targetAlphaBlendAmount = safetyhook::create_mid(pattern.get_first(), [](SafetyHookContext& regs) @@ -791,7 +805,6 @@ void Init() else regs.xmm14.f32[0] = *(float*)regs.rsi; }); - } } } diff --git a/source/GTAVCDE.FusionMod/dllmain.cpp b/source/GTAVCDE.FusionMod/dllmain.cpp index 316cd772..b2fd96ad 100644 --- a/source/GTAVCDE.FusionMod/dllmain.cpp +++ b/source/GTAVCDE.FusionMod/dllmain.cpp @@ -42,7 +42,7 @@ namespace UUI_LegalScreen HWND ghWnd; void LockCursor() { - if (ghWnd == GetFocus()) + if (ghWnd == GetForegroundWindow()) { RECT windowRect; POINT pt = { 0, 0 }; @@ -420,7 +420,7 @@ void Init() } } - if (fHudScale != 1.0f || fRadarScale != 1.0f) + //if (fHudScale != 1.0f || fRadarScale != 1.0f) { auto str = utility::scan_string(utility::get_executable(), "%s %f %f %f %f %s %s", true); if (str)