diff --git a/.gitignore b/.gitignore index 5e4b2a3..6bd9e70 100644 --- a/.gitignore +++ b/.gitignore @@ -39,3 +39,6 @@ luac.out *.hex moonloader/lib/cheat-menu/json/config.json +/CheatMenu.VC.VC.opendb +/CheatMenu.VC.db +.vs/CheatMenu/v14/.suo diff --git a/CheatMenu/CheatMenu.vcxproj.vcxproj.user b/CheatMenu/CheatMenu.vcxproj.vcxproj.user new file mode 100644 index 0000000..a11cd7f --- /dev/null +++ b/CheatMenu/CheatMenu.vcxproj.vcxproj.user @@ -0,0 +1,6 @@ + + + + true + + \ No newline at end of file diff --git a/CheatMenu/Hook.cpp b/CheatMenu/Hook.cpp index 774125a..78f2f20 100644 --- a/CheatMenu/Hook.cpp +++ b/CheatMenu/Hook.cpp @@ -24,10 +24,8 @@ LRESULT Hook::InputProc(const HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam HRESULT Hook::ResetDx9(IDirect3DDevice9 * pDevice, D3DPRESENT_PARAMETERS * pPresentationParameters) { ImGui_ImplDX9_InvalidateDeviceObjects(); - long result = oReset9(pDevice, pPresentationParameters); - ImGui_ImplDX9_CreateDeviceObjects(); - return result; + return oReset9(pDevice, pPresentationParameters); } HRESULT Hook::PresentDx9(IDirect3DDevice9 *pDevice, RECT* pSourceRect, RECT* pDestRect, HWND hDestWindowOverride, RGNDATA* pDirtyRegion) @@ -88,13 +86,9 @@ HRESULT Hook::PresentDx11(IDXGISwapChain* pSwapChain, UINT SyncInterval, UINT Fl if (Globals::init_done) { - static RwBool fullscreen = RsGlobal.ps->fullScreen; - - if (fullscreen != RsGlobal.ps->fullScreen) - { - fullscreen = RsGlobal.ps->fullScreen; + HRESULT hr = pSwapChain->Present(1, 0); + if (hr == DXGI_ERROR_DEVICE_REMOVED || hr == DXGI_ERROR_DEVICE_RESET) ImGui_ImplDX11_InvalidateDeviceObjects(); - } // Change font size if the game resolution changes if (Globals::font_screen_size.x != screen::GetScreenWidth() diff --git a/CheatMenu/Json.cpp b/CheatMenu/Json.cpp index 3e0db33..879d1d1 100644 --- a/CheatMenu/Json.cpp +++ b/CheatMenu/Json.cpp @@ -32,5 +32,6 @@ void CJson::LoadJsonData(std::vector& vec, std::string& selected) CJson::~CJson() { std::ofstream file(file_path); - file << data.dump(4) << std::endl; + file << data.dump(4,' ',false, nlohmann::json::error_handler_t::replace) << std::endl; + file.close(); } diff --git a/CheatMenu/Menu.cpp b/CheatMenu/Menu.cpp index 8023983..e7b9360 100644 --- a/CheatMenu/Menu.cpp +++ b/CheatMenu/Menu.cpp @@ -385,9 +385,10 @@ void Menu::Main() ImGui::TextWrapped("Dowglas_"); ImGui::TextWrapped("Israel"); - + ImGui::NextColumn(); ImGui::TextWrapped("Junior-Djjr"); + ImGui::TextWrapped("Um-geek"); ImGui::Columns(1); diff --git a/CheatMenu/Vehicle.cpp b/CheatMenu/Vehicle.cpp index dff4700..5bc23c4 100644 --- a/CheatMenu/Vehicle.cpp +++ b/CheatMenu/Vehicle.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "Vehicle.h" +bool Vehicle::bike_fly = false; bool Vehicle::dont_fall_bike = false; bool Vehicle::veh_engine = false; bool Vehicle::veh_heavy = false; @@ -91,10 +92,10 @@ Vehicle::Vehicle() static CPlayerPed *player = FindPlayerPed(); static int hplayer = CPools::GetPedRef(player); + CVehicle *veh = player->m_pVehicle; if (Command(hplayer)) { - CVehicle *veh = player->m_pVehicle; int hveh = CPools::GetVehicleRef(veh); Command(hveh, !veh_engine); @@ -172,6 +173,21 @@ Vehicle::Vehicle() } neon::traffic_timer = timer; } + + if (bike_fly && veh && veh->IsDriver(player)) + { + if (veh->m_nVehicleSubClass == VEHICLE_BIKE || veh->m_nVehicleSubClass == VEHICLE_BMX) + { + if (sqrt( veh->m_vecMoveSpeed.x * veh->m_vecMoveSpeed.x + + veh->m_vecMoveSpeed.y * veh->m_vecMoveSpeed.y + + veh->m_vecMoveSpeed.z * veh->m_vecMoveSpeed.z + ) > 0.0 + && CTimer::ms_fTimeStep > 0.0) + { + veh->FlyingControl(3, -9999.9902, -9999.9902, -9999.9902, -9999.9902); + } + } + } }; } @@ -615,17 +631,18 @@ void Vehicle::Main() Ui::CheckboxAddress("Aim while driving", 0x969179); Ui::CheckboxAddress("All cars have nitro", 0x969165); Ui::CheckboxAddress("All taxis have nitro", 0x96918B); + Ui::CheckboxWithHint("Bikes fly", &bike_fly); Ui::CheckboxAddress("Boats fly", 0x969153); Ui::CheckboxWithHint("Car engine", &veh_engine); - Ui::CheckboxBitFlag("Cars fly", 0x969160); + Ui::CheckboxAddress("Cars fly", 0x969160); Ui::CheckboxWithHint("Car heavy", &veh_heavy); - Ui::CheckboxBitFlag("Decreased traffic", 0x96917A); + Ui::CheckboxAddress("Decreased traffic", 0x96917A); Ui::CheckboxWithHint("Don't fall off bike", &dont_fall_bike); - Ui::CheckboxBitFlag("Drive on water", 0x969152); - Ui::CheckboxAddressEx("Lock train camera", 0x52A52F, 171, 6); + Ui::CheckboxAddress("Drive on water", 0x969152); ImGui::NextColumn(); + Ui::CheckboxAddressEx("Lock train camera", 0x52A52F, 171, 6); Ui::CheckboxAddress("Float away when hit", 0x969166); Ui::CheckboxAddress("Green traffic lights", 0x96914E); Ui::CheckboxWithHint("Invisible car", &veh_invisible); diff --git a/CheatMenu/Vehicle.h b/CheatMenu/Vehicle.h index 2a9421c..7f05f25 100644 --- a/CheatMenu/Vehicle.h +++ b/CheatMenu/Vehicle.h @@ -5,6 +5,7 @@ class Vehicle : NeonAPI, Paint { private: + static bool bike_fly; static bool dont_fall_bike; static bool veh_engine; static bool veh_heavy; diff --git a/CheatMenu/pch.h b/CheatMenu/pch.h index 305ce17..6c81891 100644 --- a/CheatMenu/pch.h +++ b/CheatMenu/pch.h @@ -3,8 +3,8 @@ #define INPUT_BUFFER_SIZE 64 #define SPAWN_PED_LIMIT 20 -#define MENU_VERSION "2.5-alpha" -#define BUILD_NUMBER "20201112" +#define MENU_VERSION "2.5-beta" +#define BUILD_NUMBER "20201206" #define STB_IMAGE_IMPLEMENTATION #include diff --git a/README.md b/README.md index 050d198..40903a8 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Cheat menu for Grand Theft Auto SanAndreas which allows a large set of modifications/cheats to be applied enabling a much more easier & amusing gameplay. -Get stable binaries from [here](https://github.com/user-grinch/Cheat-Menu/releases). Alpha binaries are available at the discord server. +Get stable binaries from [here](https://github.com/user-grinch/Cheat-Menu/releases). Beta binaries are available at the discord server. A portuguese translation of the menu is [here](https://github.com/Dowglass/Cheat-Menu)