mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-21 10:38:27 -05:00
move Mod::hook to source aswell
This commit is contained in:
parent
6cab37d5d2
commit
d4acc91d1e
2 changed files with 11 additions and 5 deletions
|
@ -293,11 +293,7 @@ namespace geode {
|
|||
void* address, void* detour, std::string const& displayName,
|
||||
tulip::hook::HandlerMetadata const& handlerMetadata,
|
||||
tulip::hook::HookMetadata const& hookMetadata
|
||||
) {
|
||||
auto hook = Hook::create(address, detour, displayName, handlerMetadata, hookMetadata);
|
||||
GEODE_UNWRAP_INTO(auto ptr, this->claimHook(std::move(hook)));
|
||||
return Ok(ptr);
|
||||
}
|
||||
);
|
||||
|
||||
/**
|
||||
* Claims an existing hook object, marking this mod as its owner.
|
||||
|
|
|
@ -141,6 +141,16 @@ bool Mod::getLaunchFlag(std::string_view const name) const {
|
|||
return m_impl->getLaunchFlag(name);
|
||||
}
|
||||
|
||||
Result<Hook*> Mod::hook(
|
||||
void* address, void* detour, std::string const& displayName,
|
||||
tulip::hook::HandlerMetadata const& handlerMetadata,
|
||||
tulip::hook::HookMetadata const& hookMetadata
|
||||
) {
|
||||
auto hook = Hook::create(address, detour, displayName, handlerMetadata, hookMetadata);
|
||||
GEODE_UNWRAP_INTO(auto ptr, this->claimHook(std::move(hook)));
|
||||
return Ok(ptr);
|
||||
}
|
||||
|
||||
Result<Hook*> Mod::claimHook(std::shared_ptr<Hook> hook) {
|
||||
return m_impl->claimHook(hook);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue