Skip to content

Commit

Permalink
add node ids for 2.0 vault and chamber of time (#109)
Browse files Browse the repository at this point in the history
* add ids for 2.0 vault and chamber of time

* fix "valtkeeper-button" typo
  • Loading branch information
flurrybun authored Nov 9, 2024
1 parent 7a85975 commit 3c9a600
Show file tree
Hide file tree
Showing 3 changed files with 87 additions and 1 deletion.
43 changes: 43 additions & 0 deletions src/SecretLayer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <Geode/Bindings.hpp>
#include <Geode/modify/SecretLayer.hpp>
#include <Geode/utils/cocos.hpp>
#include <Geode/utils/NodeIDs.hpp>

using namespace geode::prelude;
using namespace geode::node_ids;

$register_ids(SecretLayer) {
setIDs(
this,
0,
"background",
"vault-name",
"message",
"textbox-background",
"text-box",
"menu"
);
auto menu = static_cast<CCMenu*>(this->getChildByID("menu"));
setIDs(
menu,
0,
"back-button",
"vaultkeeper-button"
);
}

struct SecretLayerIDs : Modify<SecretLayerIDs, SecretLayer> {
static void onModify(auto& self) {
if (!self.setHookPriority("SecretLayer::init", GEODE_ID_PRIORITY)) {
log::warn("Failed to set SecretLayer::init hook priority, node IDs may not work properly");
}
}

bool init() {
if(!SecretLayer::init()) return false;

NodeIDs::get()->provide(this);

return true;
}
};
2 changes: 1 addition & 1 deletion src/SecretLayer2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ using namespace geode::node_ids;
menu,
0,
"back-button",
"valtkeeper-button",
"vaultkeeper-button",
"door-button",
"the-challenge-button"
);
Expand Down
43 changes: 43 additions & 0 deletions src/SecretLayer4.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
#include <Geode/Bindings.hpp>
#include <Geode/modify/SecretLayer4.hpp>
#include <Geode/utils/cocos.hpp>
#include <Geode/utils/NodeIDs.hpp>

using namespace geode::prelude;
using namespace geode::node_ids;

$register_ids(SecretLayer4) {
setIDs(
this,
0,
"background",
"vault-name",
"message",
"textbox-background",
"text-box",
"menu"
);
auto menu = static_cast<CCMenu*>(this->getChildByID("menu"));
setIDs(
menu,
0,
"back-button",
"vaultkeeper-button"
);
}

struct SecretLayer4IDs : Modify<SecretLayer4IDs, SecretLayer4> {
static void onModify(auto& self) {
if (!self.setHookPriority("SecretLayer4::init", GEODE_ID_PRIORITY)) {
log::warn("Failed to set SecretLayer4::init hook priority, node IDs may not work properly");
}
}

bool init() {
if(!SecretLayer4::init()) return false;

NodeIDs::get()->provide(this);

return true;
}
};

0 comments on commit 3c9a600

Please sign in to comment.