Skip to content

Commit

Permalink
SecretLayer2 (#98)
Browse files Browse the repository at this point in the history
* SecretLayer2

* Push2
  • Loading branch information
MuhXd authored Jul 3, 2024
1 parent a1462f5 commit 809af5a
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions src/SecretLayer2.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
#include <Geode/Bindings.hpp>
#include <Geode/modify/SecretLayer2.hpp>
#include <Geode/utils/cocos.hpp>
#include <Geode/utils/NodeIDs.hpp>

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

$register_ids(SecretLayer2) {
setIDs(
this,
0,
"background",
"vault-name",
"message",
"textbox-background",
"text-box",
"menu",
"the-challange-text1",
"the-challange-text2"
);
auto menu = static_cast<CCMenu*>(this->getChildByID("menu"));
setIDs(
menu,
0,
"back-button",
"valtkeeper-button",
"door-button",
"the-challange-button"
);
auto textbox = this->getChildByID("text-box");
setIDs(
textbox,
0,
"input",
"display-text",
"bar-position"
);
}

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

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

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

return true;
}
};

0 comments on commit 809af5a

Please sign in to comment.