feat(recovery): Enable All DLC Vehicles (#62)

This commit is contained in:
Arthur
2025-03-31 13:42:20 +03:00
committed by GitHub
parent 55629e4735
commit 3781935d04
2 changed files with 57 additions and 0 deletions
@@ -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."};
}
+2
View File
@@ -11,6 +11,8 @@ namespace YimMenu::Submenus
auto shopping = std::make_shared<Category>("Shopping");
auto vehiclesGroup = std::make_shared<Group>("Vehicles");
vehiclesGroup->AddItem(std::make_shared<BoolCommandItem>("dlcvehicles"_J));
vehiclesGroup->AddItem(std::make_unique<ImGuiItem>([] {
if (ImGui::Button("Save This Vehicle as Personal Vehicle"))
{