diff --git a/src/Options.cpp b/src/Options.cpp index 39e0ed2e..2ec1a733 100644 --- a/src/Options.cpp +++ b/src/Options.cpp @@ -52,6 +52,7 @@ Options::Options(HMODULE aModule) this->PatchAsyncCompute = config.value("disable_async_compute", this->PatchAsyncCompute); this->PatchAntialiasing = config.value("disable_antialiasing", this->PatchAntialiasing); this->DumpGameOptions = config.value("dump_game_options", this->DumpGameOptions); + this->Console = config.value("console", this->Console); } nlohmann::json config; @@ -68,6 +69,7 @@ Options::Options(HMODULE aModule) config["disable_async_compute"] = this->PatchAsyncCompute; config["disable_antialiasing"] = this->PatchAntialiasing; config["dump_game_options"] = this->DumpGameOptions; + config["console"] = this->Console; std::ofstream o(configPath); o << config.dump(4) << std::endl; diff --git a/src/Options.h b/src/Options.h index d4b34d5a..7252aa63 100644 --- a/src/Options.h +++ b/src/Options.h @@ -22,6 +22,7 @@ struct Options bool PatchAntialiasing{ false }; bool PatchSkipStartMenu{ true }; bool DumpGameOptions{ false }; + bool Console{ true }; float CPUMemoryPoolFraction{ 0.5f }; float GPUMemoryPoolFraction{ 1.f }; std::filesystem::path Path; diff --git a/src/dllmain.cpp b/src/dllmain.cpp index 08d8d5e9..7b5d54fe 100644 --- a/src/dllmain.cpp +++ b/src/dllmain.cpp @@ -69,20 +69,24 @@ void Initialize(HMODULE mod) if (options.DumpGameOptions) OptionsInitPatch(&image); - Overlay::Initialize(&image); + if(options.Console) + Overlay::Initialize(&image); MH_EnableHook(MH_ALL_HOOKS); - std::thread t([]() - { - if (kiero::init(kiero::RenderType::D3D12) != kiero::Status::Success) + if (options.Console) + { + std::thread t([]() { - spdlog::error("Kiero failed!"); - } - else - Overlay::Get().Hook(); - }); - t.detach(); + if (kiero::init(kiero::RenderType::D3D12) != kiero::Status::Success) + { + spdlog::error("Kiero failed!"); + } + else + Overlay::Get().Hook(); + }); + t.detach(); + } spdlog::default_logger()->flush(); } diff --git a/src/pool_patch.cpp b/src/pool_patch.cpp index 73fe1c8c..e62a1f61 100644 --- a/src/pool_patch.cpp +++ b/src/pool_patch.cpp @@ -87,7 +87,7 @@ void PoolPatch(Image* apImage) if (RealRegisterPoolOptions) { const auto result = MH_CreateHook(RealRegisterPoolOptions, &RegisterPoolOptions, reinterpret_cast(&RealRegisterPoolOptions)); - spdlog::info("\tPool patch: {}", result ? "success":"error"); + spdlog::info("\tPool patch: {}", result == MH_OK ? "success":"error"); } else spdlog::info("\tPool patch: failed");