-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
45 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |