mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-11 17:58:10 +08:00
feat(Remove LSC Restrictions) (#35)
* feat(Remove LSC Restrictions): Removes Los Santos Customs vehicle modification restrictions * fix(LSC Restrictions) dont enable by default
This commit is contained in:
1 parent
9f253cb98a
commit
eb192e7b4b
2 files changed
+48
No files matched your search
@@ -0,0 +1,44 @@
|
||||
#include "core/commands/BoolCommand.hpp"
|
||||
#include "game/backend/ScriptPatches.hpp"
|
||||
|
||||
namespace YimMenu::Features
|
||||
{
|
||||
//from https://github.com/TCRoid/YimMenu-Lua-RS-Missions/
|
||||
class LSCCustomsBypass : public BoolCommand
|
||||
{
|
||||
using BoolCommand::BoolCommand;
|
||||
|
||||
ScriptPatch m_CanUseVehiclePatch{};
|
||||
ScriptPatch m_BlockMenuOptionPatch{};
|
||||
|
||||
virtual void OnEnable() override
|
||||
{
|
||||
if (!m_CanUseVehiclePatch)
|
||||
{
|
||||
m_CanUseVehiclePatch = ScriptPatches::AddPatch("carmod_shop"_J, "2D ? ? ? ? 38 ? 5D ? ? ? 56 ? ? 71 2E ? ? 5D", 5, {0x72, 0x2E, 0x03, 0x01});
|
||||
}
|
||||
m_CanUseVehiclePatch->Enable();
|
||||
|
||||
if (!m_BlockMenuOptionPatch)
|
||||
{
|
||||
m_BlockMenuOptionPatch = ScriptPatches::AddPatch("carmod_shop"_J, "2D ? ? ? ? 38 ? 5D ? ? ? 5D ? ? ? 56", 5, {0x71, 0x2E, 0x01, 0x01});
|
||||
}
|
||||
m_BlockMenuOptionPatch->Enable();
|
||||
}
|
||||
|
||||
virtual void OnDisable() override
|
||||
{
|
||||
if (m_CanUseVehiclePatch)
|
||||
{
|
||||
m_CanUseVehiclePatch->Disable();
|
||||
}
|
||||
|
||||
if (m_BlockMenuOptionPatch)
|
||||
{
|
||||
m_BlockMenuOptionPatch->Disable();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
static LSCCustomsBypass _LSCCustomsBypass{"lsccustomsbypass", "Remove LSC Restrictions", "Removes Los Santos Customs vehicle modification restrictions", false};
|
||||
}
|
||||
@@ -8,6 +8,7 @@ namespace YimMenu::Submenus
|
||||
{
|
||||
auto mainGroup = std::make_shared<Category>("Spawners");
|
||||
auto spawnGroup = std::make_shared<Group>("Vehicle");
|
||||
auto modsGroup = std::make_shared<Group>("Modifications");
|
||||
|
||||
spawnGroup->AddItem(std::make_shared<StringCommandItem>("vehmodelname"_J));
|
||||
spawnGroup->AddItem(std::make_shared<BoolCommandItem>("spawninvehicle"_J));
|
||||
@@ -16,7 +17,10 @@ namespace YimMenu::Submenus
|
||||
spawnGroup->AddItem(std::make_shared<ConditionalItem>("usecustomlicenseplate"_J, std::make_shared<StringCommandItem>("customlicenseplate"_J)));
|
||||
spawnGroup->AddItem(std::make_shared<CommandItem>("spawnvehicle"_J));
|
||||
|
||||
modsGroup->AddItem(std::make_shared<BoolCommandItem>("lsccustomsbypass"_J));
|
||||
|
||||
mainGroup->AddItem(spawnGroup);
|
||||
mainGroup->AddItem(modsGroup);
|
||||
|
||||
AddCategory(std::move(mainGroup));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user