mirror of
https://github.com/YimMenu/YimMenuV2.git
synced 2026-10-10 20:03:17 +08:00
Initial port
This commit is contained in:
+32
-7
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user