-
Notifications
You must be signed in to change notification settings - Fork 20
Home
The OpenHack API is a simple way to interact with the OpenHack mod menu. It allows you to create custom menus, check current hack states, and more.
This API may be useful for developers who want to create custom mods that require some form of user interaction and don't wish to create their own implementation. It also may be useful as a way to debug or test your own mods, because you can easily edit your settings using OpenHack GUI system.
There are two ways to include the API in your mod:
- Add the API as a dependency in your
mod.json
file. This way your mod will depend on OpenHack and won't work without it. - Use dynamic symbol loading (comes included with the API) to find the API functions at runtime. This way your mod will work even if OpenHack is not installed.
To include the API in your mod, add the following to your mod.json
(replace '2.2.2' with the latest version):
{
// Your mod.json content
// ...
"dependencies": [
{
"id": "prevter.openhack",
"version": ">=2.2.2",
"platforms": ["windows"]
}
]
}
You can use the API without adding it as a dependency by using dynamic symbol loading.
All you have to do is simply include the header file in your project (if you have Geode CLI installed, it will automatically include the header file for you).
#define OPENHACK_OPTIONAL // This flag will include the API without adding it as a dependency
#include <prevter.openhack/api/openhack.hpp>
If you don't want to use Geode, you can download the API header file and include it in your project manually. Then just include it in your project like this:
#define OPENHACK_OPTIONAL // This flag will include the API with dynamic symbol loading
#include "path/to/openhack.hpp"
You can now proceed to the API Reference section to learn about which functions can be used.