https://github.com/omgrod/external-hook-api
https://github.com/omgrod/external-hook-api
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/omgrod/external-hook-api
- Owner: OmgRod
- Created: 2025-01-10T20:31:12.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-01-11T16:02:08.000Z (over 1 year ago)
- Last Synced: 2025-12-26T05:56:23.724Z (6 months ago)
- Language: C++
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
Awesome Lists containing this project
README
# External Hook API
i'm too lazy to create docs so here's some below from geodify:
### External Mods
For external mods that modify the background of a specific menu, you can use the following example. This shows how to hook into `GlobedLevelListLayer` to add a custom background.
```cpp
#include
#include "../../SwelvyBG.hpp"
#include "../../Hooks/Hooker.hpp"
using namespace geode::prelude;
Viper_Hookclass(GlobedLevelListLayer) {
if (auto bg = this->getChildByID("background")) {
bg->setVisible(false);
}
SwelvyBG* swelvyBG = SwelvyBG::create();
swelvyBG->setZOrder(-1);
swelvyBG->setID("swelvy-background");
this->addChild(swelvyBG);
}
```
This way is new from v1.7.0+!
### External Mods Fix
For external mods that really don't like you to modify the background of a specific menu, you can use the following example. This shows how to hook into `cvolton.betterinfo/CustomCreatorLayer` to add a custom background.
Please do not do this unless like in this example it's the only way since Viper_Hookclass won't work on it!
```cpp
#include
#include "../../SwelvyBG.hpp"
#include "../../Hooks/Hooker.hpp"
using namespace geode::prelude;
// class name to store in code, Hook to (the real layer id)
Viper_Hookclass_Scene(cvolton_betterinfo_CustomCreatorLayer,"cvolton.betterinfo/CustomCreatorLayer") {
if (auto bg = _This->getChildByID("cvolton.betterinfo/background")) {
bg->setVisible(false);
SwelvyBG* swelvyBG = SwelvyBG::create();
swelvyBG->setZOrder(-1);
swelvyBG->setID("swelvy-background");
_This->addChild(swelvyBG);
}
}
```
This way is new from v1.7.0+!