Fixed controls getting locked when using menu

This commit is contained in:
Grinch_ 2020-12-17 13:12:23 +06:00
parent 66463dda09
commit 79040ef9c1
3 changed files with 22 additions and 10 deletions

View File

@ -2,6 +2,16 @@ cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
project(CheatMenu CXX)
set(PROJECT_NAME CheatMenu)
################################################################################
# Configure paths
################################################################################
set(GTA_SA_DIR F:/GTASanAndreas)
# Can ignore the below paths if you got them (yes by default) in system paths
set(PLUGIN_SDK_DIR $ENV{PLUGIN_SDK_DIR})
set(DX9_DIR $ENV{DIRECTX9_SDK_DIR})
################################################################################
################################################################################
# This contains the utility functions needed for sub project, src/CMakeLists.txt
# Need to clean things up later, maybe switch to original cmake alternatives

View File

@ -96,7 +96,7 @@ string(CONCAT "MSVC_RUNTIME_LIBRARY_STR"
)
set_target_properties(${PROJECT_NAME} PROPERTIES
RUNTIME_OUTPUT_DIRECTORY "F:/GTASanAndreas/$<0:>/"
RUNTIME_OUTPUT_DIRECTORY "${GTA_SA_DIR}/$<0:>/"
SUFFIX ".asi"
MSVC_RUNTIME_LIBRARY ${MSVC_RUNTIME_LIBRARY_STR}
)
@ -105,11 +105,11 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
# Include directories
################################################################################
include_directories(
"$ENV{PLUGIN_SDK_DIR}/plugin_sa"
"$ENV{PLUGIN_SDK_DIR}/plugin_sa/game_sa"
"$ENV{PLUGIN_SDK_DIR}/shared"
"$ENV{PLUGIN_SDK_DIR}/shared/game"
"$ENV{DIRECTX9_SDK_DIR}/include"
"${PLUGIN_SDK_DIR}/plugin_sa"
"${PLUGIN_SDK_DIR}/plugin_sa/game_sa"
"${PLUGIN_SDK_DIR}/shared"
"${PLUGIN_SDK_DIR}/shared/game"
"${DX9_DIR}/include"
)
################################################################################
@ -237,7 +237,7 @@ XInput9_1_0
)
target_link_directories(${PROJECT_NAME} PUBLIC
"$ENV{PLUGIN_SDK_DIR}/output/lib/"
"${PLUGIN_SDK_DIR}/output/lib/"
"$ENV{DIRECTX9_SDK_DIR}/lib/x86/"
"external/kiero/minhook/lib/"
)

View File

@ -17,8 +17,11 @@ LRESULT Hook::InputProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
{
ImGui_ImplWin32_WndProcHandler(hWnd, uMsg, wParam, lParam);
if (ImGui::GetIO().WantCaptureKeyboard)
return 1;
if (ImGui::GetIO().WantTextInput)
{
Call<0x53F1E0>(); // CPad::ClearKeyboardHistory
return 1;
}
else
return CallWindowProc(oWndProc, hWnd, uMsg, wParam, lParam);
}
@ -176,7 +179,6 @@ void Hook::ShowMouse(bool state)
// Broken in psdk
Call<0x541BD0>(); // CPad::ClearMouseHistory
Call<0x53F1E0>(); // CPad::ClearKeyboardHistory
Call<0x541DD0>(); // CPad::UpdatePads
}