Skip to content

Commit 5c957ca

Browse files
committed
updated readme
1 parent 0bbeb0c commit 5c957ca

File tree

1 file changed

+85
-0
lines changed

1 file changed

+85
-0
lines changed

README.md

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,88 @@ A mod made to to change most menus' backgrounds to the Geode one
33

44
<img src="logo.png" width="150" alt="Logo" />
55

6+
## Building
7+
8+
To build this mod, follow one of the methods below:
9+
10+
### VS Code
11+
12+
1. Open the project in VS Code.
13+
2. Install the necessary dependencies (if not already done).
14+
3. Select the appropriate build kit for your platform. You can do this by navigating to the "CMake Tools" tab in the bottom left and selecting "Select a Kit".
15+
4. Choose the correct kit for your environment (e.g., macOS, Windows, etc.).
16+
5. After selecting the kit, you can build the project by clicking "Build" in the "CMake" tab or by using the terminal command:
17+
18+
```bash
19+
cmake --build .
20+
```
21+
This will compile the mod and generate the necessary files.
22+
23+
### GitHub Actions
24+
25+
1. Push your changes to GitHub.
26+
2. Open the repository and navigate to the Actions tab.
27+
3. Select the workflow called "Build Geode Mod".
28+
4. Choose the latest commit.
29+
5. After the build is complete, download the generated artifacts from the build step to get the built mod files.
30+
31+
## Adding Layers
32+
33+
### Geometry Dash
34+
35+
To add a custom background layer to a **Geometry Dash** menu, follow the example below. This demonstrates how to add a background layer in `CreatorLayer`.
36+
37+
```cpp
38+
#include "../SwelvyBG.hpp"
39+
#include <Geode/Geode.hpp>
40+
#include <Geode/modify/CreatorLayer.hpp>
41+
42+
using namespace geode::prelude;
43+
44+
class $modify(MyCreatorLayer, CreatorLayer) {
45+
bool init() {
46+
if (!CreatorLayer::init()) {
47+
return false;
48+
}
49+
if (Mod::get()->getSettingValue<bool>("show-creator")){
50+
if (auto bg = this->getChildByID("background")){
51+
bg->setVisible(false);
52+
}
53+
54+
auto swelvyBG = SwelvyBG::create();
55+
swelvyBG->setZOrder(-2);
56+
swelvyBG->setID("swelvy-background");
57+
58+
this->addChild(swelvyBG);
59+
}
60+
return true;
61+
}
62+
};
63+
```
64+
65+
### External Mods
66+
67+
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.
68+
69+
```cpp
70+
#include <Geode/Geode.hpp>
71+
#include "../../SwelvyBG.hpp"
72+
#include "../../Hooks/Hooker.hpp"
73+
74+
class GlobedLevelListLayer : public Betterhook::HookBetter {
75+
void init(CCNode* _This) override {
76+
if (auto bg = _This->getChildByID("background")) {
77+
bg->setVisible(false);
78+
}
79+
80+
SwelvyBG* swelvyBG = SwelvyBG::create();
81+
swelvyBG->setZOrder(-1);
82+
swelvyBG->setID("swelvy-background");
83+
_This->addChild(swelvyBG);
84+
}
85+
86+
const char* PutLayer() const override { return "GlobedLevelListLayer"; }
87+
};
88+
89+
REGISTER_HookBetter(GlobedLevelListLayer);
90+
```

0 commit comments

Comments
 (0)