diff --git a/src/LevelAreaLayer.cpp b/src/LevelAreaLayer.cpp new file mode 100644 index 0000000..9b1a970 --- /dev/null +++ b/src/LevelAreaLayer.cpp @@ -0,0 +1,59 @@ +#include +#include +#include +#include + +using namespace geode::prelude; +using namespace geode::node_ids; + +$register_ids(LevelAreaLayer) { + this->setID("main-layer"); + + this->getChildByType(0)->setID("background"); + this->getChildByType(1)->setID("tower-sprite"); + this->getChildByType(2)->setID("fade-left"); + this->getChildByType(3)->setID("fade-right"); + this->getChildByType(4)->setID("fade-bottom"); + this->getChildByType(5)->setID("light-1"); + this->getChildByType(6)->setID("tower-glow-1"); + this->getChildByType(7)->setID("light-2"); + this->getChildByType(8)->setID("tower-glow-2"); + this->getChildByType(9)->setID("light-3"); + this->getChildByType(10)->setID("tower-glow-3"); + this->getChildByType(11)->setID("light-4"); + this->getChildByType(12)->setID("tower-glow-4"); + this->getChildByType(13)->setID("light-5"); + this->getChildByType(14)->setID("tower-glow-5"); + this->getChildByType(15)->setID("light-6"); + this->getChildByType(16)->setID("tower-glow-6"); + + this->getChildByType(0)->setID("sparkle"); + + this->getChildByType(0)->setID("back-menu"); + this->getChildByType(1)->setID("enter-menu"); + + this->getChildByID("back-menu")->getChildByType(0)->setID("back-btn"); + this->getChildByID("enter-menu")->getChildByType(0)->setID("enter-btn"); + + this->getChildByType(0)->setID("top-glow"); +} + +struct LevelAreaLayerIDs : Modify { + static void onModify(auto& self) { + if (!self.setHookPriority("LevelAreaLayer::init", GEODE_ID_PRIORITY)) { + log::warn("Failed to set LevelAreaLayer::init hook priority, node IDs may not work properly"); + } + if (!self.setHookPriority("LevelAreaLayer::loadLevelsFinished", GEODE_ID_PRIORITY)) { + log::warn("Failed to set LevelAreaLayer::loadLevelsFinished hook priority, node IDs may not work properly"); + } + } + + virtual bool init() { + if (!LevelAreaLayer::init()) + return false; + + NodeIDs::get()->provide(this); + + return true; + } +}; diff --git a/src/SecretLayer3.cpp b/src/SecretLayer3.cpp new file mode 100644 index 0000000..b83f6b4 --- /dev/null +++ b/src/SecretLayer3.cpp @@ -0,0 +1,45 @@ +#include +#include +#include +#include + +using namespace geode::prelude; +using namespace geode::node_ids; + +$register_ids(SecretLayer3) { + setIDs( + this, + 0, + "background", + "cave", + "rocks", + "fire-outline", + "fire", + "light-1", + "torch-holder", + "light-2", + "bars-base", + "bars", + "eyes", + "monster", + "keys-menu", + "chest-menu", + "back-menu" + ); +} + +struct SecretLayer3IDs : Modify { + static void onModify(auto& self) { + if (!self.setHookPriority("SecretLayer3::init", GEODE_ID_PRIORITY)) { + log::warn("Failed to set SecretLayer3::init hook priority, node IDs may not work properly"); + } + } + + bool init() { + if(!SecretLayer3::init()) return false; + + NodeIDs::get()->provide(this); + + return true; + } +}; \ No newline at end of file diff --git a/src/SecretLayer6.cpp b/src/SecretLayer6.cpp new file mode 100644 index 0000000..4829036 --- /dev/null +++ b/src/SecretLayer6.cpp @@ -0,0 +1,39 @@ +#include "Geode/cocos/label_nodes/CCLabelBMFont.h" +#include +#include +#include +#include + +using namespace geode::prelude; +using namespace geode::node_ids; + +$register_ids(SecretLayer6) { + this->setID("main-layer"); + + this->getChildByType(0)->setID("background"); + this->getChildByType(0)->setID("title"); + this->getChildByType(0)->setID("minigame"); + this->getChildByType(0)->setID("back-menu"); + + this->getChildByID("back-menu")->getChildByType(0)->setID("back-btn"); +} + +struct SecretLayer6IDs : Modify { + static void onModify(auto& self) { + if (!self.setHookPriority("SecretLayer6::init", GEODE_ID_PRIORITY)) { + log::warn("Failed to set SecretLayer6::init hook priority, node IDs may not work properly"); + } + if (!self.setHookPriority("SecretLayer6::loadLevelsFinished", GEODE_ID_PRIORITY)) { + log::warn("Failed to set SecretLayer6::loadLevelsFinished hook priority, node IDs may not work properly"); + } + } + + virtual bool init() { + if (!SecretLayer6::init()) + return false; + + NodeIDs::get()->provide(this); + + return true; + } +};