Skip to content

Commit

Permalink
if someone wants to do playlayer
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Feb 4, 2024
1 parent 28d95de commit b313c15
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions src/PlayLayer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#include <Geode/Bindings.hpp>
#include <Geode/modify/PlayLayer.hpp>
#include <Geode/utils/cocos.hpp>
#include <Geode/utils/NodeIDs.hpp>

#include "IDCheck.hpp"

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

#if 0

$register_ids(PlayLayer) {
setIDSafe(this, 1, "main-node");
setIDSafe(this, 3, "hitbox-node");
setIDSafe(this, 4, "effect-manager");
setIDSafe(this, 6, "ui-layer");
setIDSafe(this, 7, "debug-text");
setIDSafe(this, 8, "progress-bar");

auto level = PlayLayer::get()->m_level;
if (level->isPlatformer()) {
setIDSafe(this, 9, "time-label");
}
else {
setIDSafe(this, 9, "percentage-label");
}
}

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

bool init(GJGameLevel* level, bool p1, bool p2) {
if (!PlayLayer::init(level, p1, p2)) return false;

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

return true;
}
};
#endif

0 comments on commit b313c15

Please sign in to comment.