Skip to content

Commit

Permalink
improve readme
Browse files Browse the repository at this point in the history
  • Loading branch information
HJfod committed Feb 15, 2024
1 parent 6329c1a commit 6862538
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,42 @@
# NodeIDs

Standard node IDs for layers in Geode.

Whenever you hook a layer in Geode and want to add stuff to it, in order to preserve compatability with other mods, you should always use node IDs rather than `objectAtIndex` calls. You need to depend on this mod to add the IDs.

For more information, [read the docs page on IDs & Layouts](https://docs.geode-sdk.org/tutorials/nodetree).

## Using as a dependency

Add the mod to your `mod.json`:

```json
{
"dependencies": [
{
"id": "geode.node-ids",
"version": "v1.5.0",
"importance": "required"
}
]
}
```

**All the hooks in this mod have very low priority and as such should always be automatically run before your hooks.** However, if you want to ensure that IDs have been provided for your modified layer, call `NodeIDs::provideFor` (Geode function, not from this mod):

```cpp
#include <Geode/modify/EditorUI.hpp>

using namespace geode::prelude;

class $modify(EditorUI) {
bool init(LevelEditorLayer* lel) {
if (!EditorUI::init(lel))
return false;

NodeIDs::provideFor(this);

return true;
}
};
```

0 comments on commit 6862538

Please sign in to comment.