From 5c9066618dea09ca5835ca236980fcf27b8b5b0d Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Mon, 12 Dec 2022 19:41:42 +0300 Subject: [PATCH] add debug texts --- loader/src/loader/Hook.cpp | 10 +++++----- loader/src/loader/Mod.cpp | 3 ++- loader/src/main.cpp | 2 ++ 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/loader/src/loader/Hook.cpp b/loader/src/loader/Hook.cpp index e9f3e9fd..528d9a33 100644 --- a/loader/src/loader/Hook.cpp +++ b/loader/src/loader/Hook.cpp @@ -45,7 +45,7 @@ tulip::hook::HookMetadata Hook::getHookMetadata() const { } void Hook::setHookMetadata(tulip::hook::HookMetadata const& metadata) { - m_impl->setHookMetadata(metadata); + return m_impl->setHookMetadata(metadata); } int32_t Hook::getPriority() const { @@ -53,7 +53,7 @@ int32_t Hook::getPriority() const { } void Hook::setPriority(int32_t priority) { - m_impl->setPriority(priority); + return m_impl->setPriority(priority); } bool Hook::getAutoEnable() const { @@ -61,12 +61,12 @@ bool Hook::getAutoEnable() const { } void Hook::setAutoEnable(bool autoEnable) { - m_impl->setAutoEnable(autoEnable); + return m_impl->setAutoEnable(autoEnable); } Result<> Hook::enable() { - m_impl->enable(); + return m_impl->enable(); } Result<> Hook::disable() { - m_impl->disable(); + return m_impl->disable(); } \ No newline at end of file diff --git a/loader/src/loader/Mod.cpp b/loader/src/loader/Mod.cpp index 090dca1d..d79da427 100644 --- a/loader/src/loader/Mod.cpp +++ b/loader/src/loader/Mod.cpp @@ -407,6 +407,7 @@ bool Mod::depends(std::string const& id) const { // Hooks Result<> Mod::enableHook(Hook* hook) { + log::debug("Enabling hook {} for mod {}", (void*)hook, m_info.id); auto res = hook->enable(); if (res) m_hooks.push_back(hook); @@ -423,7 +424,7 @@ Result Mod::addHook(Hook* hook) { auto res = this->enableHook(hook); if (!res) { delete hook; - return Err("Can't create hook"); + return Err("Can't create hook: "+ res.unwrapErr()); } } } diff --git a/loader/src/main.cpp b/loader/src/main.cpp index 9694f989..95c38190 100644 --- a/loader/src/main.cpp +++ b/loader/src/main.cpp @@ -147,6 +147,8 @@ static auto $_ = listenForIPC("list-mods", [](IPCEvent* event) -> nlohmann::json int geodeEntry(void* platformData) { // setup internals + Loader::get()->openPlatformConsole(); + if (!Loader::get()) { LoaderImpl::get()->platformMessageBox( "Unable to Load Geode!",