Initial port

This commit is contained in:
maybegreat48
2025-03-13 16:59:02 -04:00
parent c2f19fe029
commit aa3746462b
120 changed files with 11235 additions and 7012 deletions
+32 -7
View File
@@ -1,37 +1,62 @@
#include "common.hpp"
#include "core/backend/ScriptMgr.hpp"
#include "core/backend/FiberPool.hpp"
#include "core/commands/Commands.hpp"
#include "core/commands/HotkeySystem.hpp"
#include "core/settings/Settings.hpp"
#include "core/filemgr/FileMgr.hpp"
#include "core/frontend/Notifications.hpp"
#include "core/hooking/Hooking.hpp"
#include "core/memory/ModuleMgr.hpp"
#include "core/renderer/Renderer.hpp"
#include "game/frontend/GUI.hpp"
#include "game/gta/Natives.hpp"
#include "game/pointers/Pointers.hpp"
namespace YimMenu
{
DWORD Main(void*)
{
const auto documents = std::filesystem::path(std::getenv("USERPROFILE")) / "Documents";
FileMgr::Init(documents / "HellBase");
const auto documents = std::filesystem::path(std::getenv("appdata")) / "YimMenuV2";
FileMgr::Init(documents);
LogHelper::Init("henlo", FileMgr::GetProjectFile("./cout.log"));
LogHelper::Init("YimMenuV2", FileMgr::GetProjectFile("./cout.log"));
g_HotkeySystem.RegisterCommands();
Settings::Initialize(FileMgr::GetProjectFile("./settings.json"));
if (!ModuleMgr.LoadModules())
goto unload;
if (!Pointers.Init())
goto unload;
if (!Renderer::Init())
goto unload;
GUI::Init();
Hooking::Init();
ScriptMgr::Init();
LOG(INFO) << "ScriptMgr initialized";
FiberPool::Init(5);
LOG(INFO) << "FiberPool initialized";
GUI::Init();
while (g_Running)
{
std::this_thread::sleep_for(100ms);
LOG(INFO) << ENTITY::GET_ENTITY_HEALTH(PLAYER::PLAYER_PED_ID());
Settings::Tick();
std::this_thread::yield();
}
ScriptMgr::AddScript(std::make_unique<Script>(&Commands::RunScript));
Notifications::Show("YimMenuV2", "Loaded succesfully", NotificationType::Success);
unload:
LOG(INFO) << "Unloading";
ScriptMgr::Destroy();
FiberPool::Destroy();
Hooking::Destroy();
Renderer::Destroy();
LogHelper::Destroy();