mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-22 15:37:53 -05:00
better README
This commit is contained in:
parent
46e3a071d3
commit
56ebed9d81
1 changed files with 28 additions and 46 deletions
74
README.md
74
README.md
|
@ -1,61 +1,43 @@
|
|||
![Geode Logo](https://github.com/geode-sdk.png?size=80)
|
||||
|
||||
# Geode SDK
|
||||
Geode is a revolutionary Geometry Dash modding framework. Documentation on using the Geode SDK can be found on the [Geode Documentation](https://geode-sdk.github.io/docs/).
|
||||
|
||||
## SDK
|
||||
**Geode** is a [Geometry Dash](https://store.steampowered.com/app/322170/Geometry_Dash/) **mod loader** and **modding SDK** with a modern approach towards mod development. Unlike previous mod loaders, which merely inject the DLLs and let devs handle the rest, Geode aims to be a more comprehensive project, which manages loaded mods & hooks itself. Geode has been built to ensure performance, compatibility, portability and ease of use. For devs, Geode means **easy development and portability**; for end users, Geode means **an uniform and easy experience** using mods.
|
||||
|
||||
The SDK repo contains headers for Geometry Dash, Cocos2d-x, and the Geode framework itself. The Geometry Dash headers are generated using codegen, although pre-genned headers can be found through the [bin](https://github.com/geode-sdk/bin) submodule.
|
||||
## Why Geode?
|
||||
|
||||
## Basic Usage
|
||||
|
||||
While traditional modding techniques involve convoluted setups using hooking libraries and calling conventions, Geode simplifies the development of mods to a single macro: `$modify`. Using it, you can hook functions in any class as long as the addresses of those functions is defined in the codegenned bindings.
|
||||
|
||||
For example, to alter the behaviour of the "More Games" button in GD, all you have to do is this:
|
||||
There's nothing worse than having to read thousands of words just to see what some library's code actually looks like, so instead, here's a **Hello World** in Geode right off the bat:
|
||||
|
||||
```cpp
|
||||
#include <Geode.hpp>
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
class $modify(MenuLayer) {
|
||||
void onMoreGames(CCObject*) {
|
||||
FLAlertLayer::create(
|
||||
"Geode",
|
||||
"Hello World from my Custom Mod!",´
|
||||
"OK"
|
||||
)->show();
|
||||
}
|
||||
void onMoreGames(CCObject*) {
|
||||
FLAlertLayer::create(
|
||||
"Geode",
|
||||
"Hello World from my Custom Mod!",
|
||||
"OK"
|
||||
)->show();
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
> :warning: Make sure that your overridden funcion's signature matches the original's. Emitting parameters / the `virtual` keyword may cause issues.
|
||||
This code hooks the "More Games" button in Geometry Dash, and makes it show a different popup when clicked. Compared to traditional modding methods such as MinHook, we would argue that this is **much easier to write, understand & maintain**.
|
||||
|
||||
If you want to call the original function, all you need to do is the base class name and the function name, in the same way you would call the base of a virtual function.
|
||||
Geode is in many ways a **declarative framework**; you tell it what you want, not how to accomplish it. Geode has been built to let modders focus on what mod they want to make, not how exactly to build it. Its goal is to **abstract away** unnecessary details, while still enabling developers have **precise control** over their mod.
|
||||
|
||||
```cpp
|
||||
class $modify(MenuLayer) {
|
||||
bool init() {
|
||||
if (!MenuLayer::init())
|
||||
return false;
|
||||
|
||||
auto label = CCLabelBMFont::create("Hello world!", "bigFont.fnt");
|
||||
label->setPosition(100, 100);
|
||||
this->addChild(label);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
||||
```
|
||||
|
||||
If you to give a name to your modified class, specify it as the first parameter to `$modify`:
|
||||
|
||||
```cpp
|
||||
class $modify(CustomMenuLayer, MenuLayer) {
|
||||
void onMoreGames(CCObject*) {
|
||||
FLAlertLayer::create(
|
||||
"Geode",
|
||||
"Hello World from my Custom Mod!",´
|
||||
"OK"
|
||||
)->show();
|
||||
}
|
||||
};
|
||||
```
|
||||
One of our main design goals with Geode has been to make a framework so good that **after using it once, you never want to go back**.
|
||||
|
||||
## Documentation
|
||||
|
||||
Documentation on using the Geode SDK can be found on the [Geode Documentation](https://geode-sdk.github.io/docs/).
|
||||
Detailed documentation, tutorials, and references on using the Geode SDK can be found [here](https://geode-sdk.github.io/docs/).
|
||||
|
||||
## Contribution
|
||||
|
||||
You can contribute to Geode by opening a [Pull Request](https://github.com/geode-sdk/geode/pulls)!
|
||||
|
||||
## Questions, help, etc.
|
||||
|
||||
If you have any further questions, need help, or just want to share your love for catgirls, be sure to join [our Discord server](https://discord.gg/9e43WMKzhp)!
|
||||
|
|
Loading…
Reference in a new issue