add debug texts

This commit is contained in:
altalk23 2022-12-12 19:41:42 +03:00
parent 437a996b14
commit 5c9066618d
3 changed files with 9 additions and 6 deletions

View file

@ -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();
}

View file

@ -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<Hook*> 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());
}
}
}

View file

@ -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!",