diff --git a/src/game/features/recovery/DLCVehicles.cpp b/src/game/features/recovery/DLCVehicles.cpp new file mode 100644 index 0000000..98706c9 --- /dev/null +++ b/src/game/features/recovery/DLCVehicles.cpp @@ -0,0 +1,55 @@ +#include "core/commands/BoolCommand.hpp" +#include "game/backend/ScriptPatches.hpp" + +namespace YimMenu::Features +{ + class DLCVehicles : public BoolCommand + { + using BoolCommand::BoolCommand; + + ScriptPatch m_VehiclePOSIXPatch{}; + ScriptPatch m_GetVehiclePricePatch{}; + ScriptPatch m_BuyVehiclePatch{}; + + virtual void OnEnable() override + { + if (!m_VehiclePOSIXPatch) + { + m_VehiclePOSIXPatch = ScriptPatches::AddPatch("appinternet"_J, "59 ? ? 72 2E 02 01", 0, {0x2B, 0x00, 0x00}); + } + m_VehiclePOSIXPatch->Enable(); + + if (!m_GetVehiclePricePatch) + { + m_GetVehiclePricePatch = ScriptPatches::AddPatch("appinternet"_J, "56 ? ? 70 2E 04 01 38 01", 0, {0x55}); + } + m_GetVehiclePricePatch->Enable(); + + if (!m_BuyVehiclePatch) + { + m_BuyVehiclePatch = ScriptPatches::AddPatch("appinternet"_J, "5D ? ? ? 06 56 ? ? 38 00 25 ? 50", 5, {0x55}); + } + m_BuyVehiclePatch->Enable(); + } + + virtual void OnDisable() override + { + if (m_VehiclePOSIXPatch) + { + m_VehiclePOSIXPatch->Disable(); + } + + if (m_GetVehiclePricePatch) + { + m_GetVehiclePricePatch->Disable(); + } + + if (m_BuyVehiclePatch) + { + m_BuyVehiclePatch->Disable(); + } + } + }; + + static DLCVehicles _DLCVehicles{"dlcvehicles", "Enable All DLC Vehicles", "Enables all the DLC vehicles on websites."}; +} \ No newline at end of file diff --git a/src/game/frontend/submenus/Recovery.cpp b/src/game/frontend/submenus/Recovery.cpp index 10ab1cf..8c3a0d8 100644 --- a/src/game/frontend/submenus/Recovery.cpp +++ b/src/game/frontend/submenus/Recovery.cpp @@ -11,6 +11,8 @@ namespace YimMenu::Submenus auto shopping = std::make_shared("Shopping"); auto vehiclesGroup = std::make_shared("Vehicles"); + vehiclesGroup->AddItem(std::make_shared("dlcvehicles"_J)); + vehiclesGroup->AddItem(std::make_unique([] { if (ImGui::Button("Save This Vehicle as Personal Vehicle")) {