Skip to content

Commit 6989204

Browse files
committed
added some docs
1 parent 0a81cfe commit 6989204

File tree

1 file changed

+46
-1
lines changed

1 file changed

+46
-1
lines changed

README.md

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,49 @@ using namespace geode::prelude;
7777
SET_SWELVY(GlobedLevelListLayer, "dankmeme.globed2/GlobedLevelListLayer", "background");
7878

7979
```
80-
This way is new from v2.0.0+!
80+
This way is new from v2.0.0+!
81+
82+
### Registering Layers
83+
84+
When adding a layer, it must also be registered. To do this, follow the steps below:
85+
86+
1. Add it to `mod.json`
87+
88+
```json
89+
{
90+
"settings": {
91+
"[Mod ID]/[Layer Name]": {
92+
"name": "[Layer Name]",
93+
"description": "[Layer Name]",
94+
"type": "bool",
95+
"default": true
96+
},
97+
}
98+
}
99+
```
100+
101+
2. Add it to `src/Tags.hpp`
102+
103+
```cpp
104+
m_tagMap = {
105+
{"[Mod ID]-[Layer Name]", 0 /* Tag ID - should be unique */},
106+
}
107+
108+
m_stringMap = {
109+
{0 /* Tag ID - should be unique */, "[Mod ID]-[Layer Name]"},
110+
}
111+
```
112+
113+
3. Add the mod to `src/layers/GYSettingSelectLayer.cpp`
114+
115+
> [!IMPORTANT]
116+
> You should only do this if the layer you are adding is for a new mod that isn't yet in Geodify.
117+
118+
> [!NOTE]
119+
> As of writing this, the relevant code is located in `lines 158-175`
120+
121+
```cpp
122+
auto modTiles = {
123+
GYModTile::create("[Mod Name]", "[Developer Name(s)]", "[Mod ID]"),
124+
}
125+
```

0 commit comments

Comments
 (0)