feat(world): Enable Creator Dev Mode (#514)

* feat(world): Enable Creator Dev Mode

* format tabs
This commit is contained in:
Arthur
2025-06-20 18:45:15 +03:00
committed by GitHub
parent 24a61a6fd2
commit 32ba8c8784
2 changed files with 43 additions and 0 deletions
@@ -0,0 +1,42 @@
#include "core/commands/BoolCommand.hpp"
#include "game/backend/ScriptPatches.hpp"
namespace YimMenu
{
static constexpr auto creatorScripts = std::to_array({
"fm_race_creator"_J,
"fm_survival_creator"_J,
"fm_lts_creator"_J,
"fm_deathmatch_creator"_J,
"fm_capture_creator"_J,
});
class EnableCreatorDevMode : public BoolCommand
{
using BoolCommand::BoolCommand;
std::vector<ScriptPatch> m_IsDevModeEnabledPatches;
virtual void OnEnable() override
{
if (m_IsDevModeEnabledPatches.empty())
{
for (int i = 0; i < creatorScripts.size(); i++)
{
m_IsDevModeEnabledPatches.push_back(ScriptPatches::AddPatch(creatorScripts[i], ScriptPointer("IsDevModeEnabledPatch", "5D ? ? ? 56 ? ? 38 00 46 F0 0B").Add(1).Rip(), {0x2D, 0x00, 0x02, 0x00, 0x00, 0x72, 0x2E, 0x00, 0x01}));
}
}
for (auto& patch : m_IsDevModeEnabledPatches)
patch->Enable();
}
virtual void OnDisable() override
{
for (auto& patch : m_IsDevModeEnabledPatches)
patch->Disable();
}
};
static EnableCreatorDevMode _EnableCreatorDevMode{"enablecreatordevmode", "Enable Creator Dev Mode", "Enables the developer mode in Creator."};
}
+1
View File
@@ -42,6 +42,7 @@ namespace YimMenu::Submenus
otherOpts->AddItem(std::make_shared<BoolCommandItem>("pedsignore"_J));
otherOpts->AddItem(std::make_shared<BoolCommandItem>("PedRiotMode"_J));
otherOpts->AddItem(std::make_shared<BoolCommandItem>("CopsDispatch"_J));
otherOpts->AddItem(std::make_shared<BoolCommandItem>("enablecreatordevmode"_J));
main->AddItem(std::move(killPeds));
main->AddItem(std::move(deleteOpts));