Skip to content

Commit

Permalink
add batch-layer for basegamelayer
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Mar 30, 2024
1 parent 4c649ba commit 6147904
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion mod.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"android": "2.205",
"mac": "2.200"
},
"version": "v1.8.1",
"version": "v1.8.2",
"id": "geode.node-ids",
"name": "Node IDs",
"developer": "Geode Team",
Expand Down
7 changes: 4 additions & 3 deletions src/LevelEditorLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,12 @@ using namespace geode::node_ids;

if (auto shaderLayer = getChildOfType<ShaderLayer>(this, 0)) {
setIDSafe(shaderLayer, 1, "main-node");
setIDSafe<CCSprite>(static_cast<CCNode*>(shaderLayer->getChildren()->objectAtIndex(1)), 0, "background");
} else {
setIDSafe(this, 1, "main-node");
setIDSafe<CCSprite>(static_cast<CCNode*>(this->getChildren()->objectAtIndex(1)), 0, "background");
setIDSafe(this, 1, "main-node");
}
auto mainNode = this->getChildByIDRecursive("main-node");
setIDSafe<CCSprite>(mainNode, 0, "background");
setIDSafe<CCLayer>(mainNode, 0, "batch-layer");
}

struct LevelEditorLayerIDs : Modify<LevelEditorLayerIDs, LevelEditorLayer> {
Expand Down
4 changes: 3 additions & 1 deletion src/PlayLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ using namespace geode::node_ids;

$register_ids(PlayLayer) {
setIDSafe(this, 1, "main-node");
setIDSafe<CCSprite>(static_cast<CCNode*>(this->getChildren()->objectAtIndex(1)), 0, "background");
auto mainNode = this->getChildByID("main-node");
setIDSafe<CCSprite>(mainNode, 0, "background");
setIDSafe<CCLayer>(mainNode, 0, "batch-layer");

setIDSafe(this, 3, "hitbox-node");
setIDSafe<GJEffectManager>(this, 0, "effect-manager");
Expand Down

0 comments on commit 6147904

Please sign in to comment.