From db22f1c9dbea854e9e946bf6b002229cea18da6b Mon Sep 17 00:00:00 2001 From: Grinch_ Date: Mon, 23 Aug 2021 19:40:53 +0600 Subject: [PATCH] Fix sa image scaling bug, add vc never wanted --- .vscode/c_cpp_properties.json | 10 +++++----- src/MenuInfo.h | 2 +- src/Player.cpp | 19 +++++++++++++++++++ src/Ui.cpp | 13 +++++++------ src/Vehicle.cpp | 2 ++ 5 files changed, 34 insertions(+), 12 deletions(-) diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json index aa011ad..9bf22bb 100644 --- a/.vscode/c_cpp_properties.json +++ b/.vscode/c_cpp_properties.json @@ -6,10 +6,10 @@ "${workspaceFolder}/**", "${PLUGIN_SDK_DIR}/*", "${DIRECTX9_SDK_DIR}/Include/*", - "${PLUGIN_SDK_DIR}/plugin_sa/*", - "${PLUGIN_SDK_DIR}/plugin_sa/game_sa/*", - // "${PLUGIN_SDK_DIR}/plugin_vc/*", - // "${PLUGIN_SDK_DIR}/plugin_vc/game_vc/*", + // "${PLUGIN_SDK_DIR}/plugin_sa/*", + // "${PLUGIN_SDK_DIR}/plugin_sa/game_sa/*", + "${PLUGIN_SDK_DIR}/plugin_vc/*", + "${PLUGIN_SDK_DIR}/plugin_vc/game_vc/*", "${PLUGIN_SDK_DIR}/shared/*", "${PLUGIN_SDK_DIR}/shared/game/*", "C:\\Program Files (x86)\\Windows Kits\\10\\Include\\10.0.19041.0\\ucrt\\*", @@ -20,7 +20,7 @@ "IS_PLATFORM_WIN", "_CRT_SECURE_NO_WARNINGS", "_CRT_NON_CONFORMING_SWPRINTFS", - "GTASA", + "GTAVC", "_DX9_SDK_INSTALLED", "PLUGIN_SGV_10US" ], diff --git a/src/MenuInfo.h b/src/MenuInfo.h index 3ba1430..bfc7da3 100644 --- a/src/MenuInfo.h +++ b/src/MenuInfo.h @@ -2,5 +2,5 @@ #define MENU_NAME "Cheat Menu" #define MENU_VERSION_NUMBER "2.9" #define MENU_VERSION MENU_VERSION_NUMBER"-beta" -#define BUILD_NUMBER "20210821" +#define BUILD_NUMBER "20210823" #define MENU_TITLE MENU_NAME " v" MENU_VERSION "(" BUILD_NUMBER ")" diff --git a/src/Player.cpp b/src/Player.cpp index 6e4177b..0f2ddf5 100644 --- a/src/Player.cpp +++ b/src/Player.cpp @@ -333,6 +333,25 @@ void Player::Draw() { CCheat::NotWantedCheat(); } +#elif GTAVC + static bool neverWanted = false; + if (Ui::CheckboxWithHint("Never wanted", &neverWanted)) + { + if (neverWanted) + { + pPlayer->m_pWanted->CheatWantedLevel(0); + pPlayer->m_pWanted->Update(); + patch::SetRaw(0x4D2110, (char*)"\xC3\x90\x90\x90\x90\x90", 6); // CWanted::UpdateWantedLevel() + patch::Nop(0x5373D0, 5); // CWanted::Update(); + } + else + { + pPlayer->m_pWanted->CheatWantedLevel(0); + pPlayer->m_pWanted->ClearQdCrimes(); + patch::SetRaw(0x4D2110, (char*)"\x8B\x15\xDC\x10\x69\x00", 6); + patch::SetRaw(0x5373D0, (char*)"\xE8\x8B\xAE\xF9\xFF", 5); + } + } #endif Ui::CheckboxAddress("No arrest fee", (int)&pInfo->m_bGetOutOfJailFree); diff --git a/src/Ui.cpp b/src/Ui.cpp index ad1576c..642036c 100644 --- a/src/Ui.cpp +++ b/src/Ui.cpp @@ -490,12 +490,13 @@ void Ui::DrawImages(ResourceStore &store, std::function onLe Trying to scale images based on resolutions Native 1366x768 */ - store.m_ImageSize.x *= screen::GetScreenWidth() / 1366.0f; - store.m_ImageSize.y *= screen::GetScreenHeight() / 768.0f; + ImVec2 m_ImageSize = store.m_ImageSize; + m_ImageSize.x *= screen::GetScreenWidth() / 1366.0f; + m_ImageSize.y *= screen::GetScreenHeight() / 768.0f; int imageCount = 1; - int imagesInRow = static_cast(ImGui::GetWindowContentRegionWidth() / store.m_ImageSize.x); - store.m_ImageSize.x = ImGui::GetWindowContentRegionWidth() / imagesInRow - static_cast(ImGuiStyleVar_ItemSpacing) * 0.65f; + int imagesInRow = static_cast(ImGui::GetWindowContentRegionWidth() / m_ImageSize.x); + m_ImageSize.x = ImGui::GetWindowContentRegionWidth() / imagesInRow - static_cast(ImGuiStyleVar_ItemSpacing) * 0.65f; ImGui::Spacing(); @@ -544,7 +545,7 @@ void Ui::DrawImages(ResourceStore &store, std::function onLe } else { - if (ImGui::ImageButton(store.m_ImagesList[i]->m_pTexture, store.m_ImageSize, ImVec2(0, 0), ImVec2(1, 1), 1, ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1))) + if (ImGui::ImageButton(store.m_ImagesList[i]->m_pTexture, m_ImageSize, ImVec2(0, 0), ImVec2(1, 1), 1, ImVec4(1, 1, 1, 1), ImVec4(1, 1, 1, 1))) { onLeftClick(text); } @@ -570,7 +571,7 @@ void Ui::DrawImages(ResourceStore &store, std::function onLe // Calculating and drawing text over the image ImVec2 textSize = ImGui::CalcTextSize(modelName.c_str()); - if (textSize.x < store.m_ImageSize.x) + if (textSize.x < m_ImageSize.x) { float offsetX = (ImGui::GetItemRectSize().x - textSize.x) / 2; drawlist->AddText(ImVec2(btnMin.x + offsetX, btnMin.y + 10), ImGui::GetColorU32(ImGuiCol_Text), diff --git a/src/Vehicle.cpp b/src/Vehicle.cpp index a3fdf13..b8e9bfd 100644 --- a/src/Vehicle.cpp +++ b/src/Vehicle.cpp @@ -281,7 +281,9 @@ void Vehicle::ParseVehiclesIDE() while (getline(file, line)) { if (line[0] <= '0' || line[0] >= '9') + { continue; + } try {