From 6147904a3e22f0d6f03acea21856e629d928ccf6 Mon Sep 17 00:00:00 2001 From: altalk23 <45172705+altalk23@users.noreply.github.com> Date: Sat, 30 Mar 2024 14:40:07 +0300 Subject: [PATCH] add batch-layer for basegamelayer --- mod.json | 2 +- src/LevelEditorLayer.cpp | 7 ++++--- src/PlayLayer.cpp | 4 +++- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mod.json b/mod.json index 4a5b027..c02de5c 100644 --- a/mod.json +++ b/mod.json @@ -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", diff --git a/src/LevelEditorLayer.cpp b/src/LevelEditorLayer.cpp index 3d6f3e7..467cdfb 100644 --- a/src/LevelEditorLayer.cpp +++ b/src/LevelEditorLayer.cpp @@ -13,11 +13,12 @@ using namespace geode::node_ids; if (auto shaderLayer = getChildOfType(this, 0)) { setIDSafe(shaderLayer, 1, "main-node"); - setIDSafe(static_cast(shaderLayer->getChildren()->objectAtIndex(1)), 0, "background"); } else { - setIDSafe(this, 1, "main-node"); - setIDSafe(static_cast(this->getChildren()->objectAtIndex(1)), 0, "background"); + setIDSafe(this, 1, "main-node"); } + auto mainNode = this->getChildByIDRecursive("main-node"); + setIDSafe(mainNode, 0, "background"); + setIDSafe(mainNode, 0, "batch-layer"); } struct LevelEditorLayerIDs : Modify { diff --git a/src/PlayLayer.cpp b/src/PlayLayer.cpp index 85d7b89..4e4d82a 100644 --- a/src/PlayLayer.cpp +++ b/src/PlayLayer.cpp @@ -10,7 +10,9 @@ using namespace geode::node_ids; $register_ids(PlayLayer) { setIDSafe(this, 1, "main-node"); - setIDSafe(static_cast(this->getChildren()->objectAtIndex(1)), 0, "background"); + auto mainNode = this->getChildByID("main-node"); + setIDSafe(mainNode, 0, "background"); + setIDSafe(mainNode, 0, "batch-layer"); setIDSafe(this, 3, "hitbox-node"); setIDSafe(this, 0, "effect-manager");