mirror of
https://github.com/geode-sdk/geode.git
synced 2025-03-26 04:39:51 -04:00
UILayer id
This commit is contained in:
parent
08df8c627a
commit
9465d7ff75
1 changed files with 34 additions and 0 deletions
34
loader/src/ids/UILayer.cpp
Normal file
34
loader/src/ids/UILayer.cpp
Normal file
|
@ -0,0 +1,34 @@
|
|||
#include <Geode/Modify.hpp>
|
||||
#include <Geode/Bindings.hpp>
|
||||
#include <Geode/utils/cocos.hpp>
|
||||
#include "AddIDs.hpp"
|
||||
|
||||
USE_GEODE_NAMESPACE();
|
||||
|
||||
$register_ids(UILayer) {
|
||||
if (auto menu = getChildOfType<CCMenu>(this, 0)) {
|
||||
menu->setID("pause-button-menu");
|
||||
|
||||
setIDs(menu, 0, "pause-button");
|
||||
}
|
||||
|
||||
if (auto menu = getChildOfType<CCMenu>(this, 1)) {
|
||||
menu->setID("checkpoint-menu");
|
||||
|
||||
setIDs(menu, 0,
|
||||
"add-checkpoint-button",
|
||||
"remove-checkpoint-button"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class $modify(UILayer) {
|
||||
bool init() {
|
||||
if (!UILayer::init())
|
||||
return false;
|
||||
|
||||
NodeIDs::get()->provide(this);
|
||||
|
||||
return true;
|
||||
}
|
||||
};
|
Loading…
Add table
Reference in a new issue