-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* charactercolorpage :D * no bindings for macos yet :(
- Loading branch information
1 parent
ce5dc0e
commit e39b215
Showing
1 changed file
with
73 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,73 @@ | ||
#include <Geode/Geode.hpp> | ||
#ifndef GEODE_IS_MACOS | ||
|
||
#include <Geode/Bindings.hpp> | ||
#include <Geode/modify/CharacterColorPage.hpp> | ||
#include <Geode/utils/cocos.hpp> | ||
#include <Geode/utils/NodeIDs.hpp> | ||
|
||
using namespace geode::prelude; | ||
using namespace geode::node_ids; | ||
|
||
$register_ids(CharacterColorPage) { | ||
size_t offset = 0; | ||
|
||
auto colorsLayer = static_cast<CCLayer*>(this->getChildren()->objectAtIndex(0)); | ||
colorsLayer->setID("colors-layer"); | ||
|
||
setIDSafe(colorsLayer, offset++, "background"); | ||
if (auto menu = getChildOfType<CCMenu>(colorsLayer, 0)) { | ||
menu->setID("buttons-menu"); | ||
setIDs( | ||
menu, | ||
0, | ||
"close-button", | ||
"ship-button", | ||
"col1-button", | ||
"col2-button", | ||
"glow-button" | ||
); | ||
|
||
for (int i = 5; i < menu->getChildrenCount()-1; i++) { | ||
auto child = as<CCMenuItemSpriteExtra*>(menu->getChildren()->objectAtIndex(i)); | ||
child->setID(std::to_string(child->getTag())); | ||
} | ||
|
||
setIDSafe(menu, menu->getChildrenCount()-1, "glow-toggler"); | ||
} | ||
|
||
offset++; | ||
setIDs( | ||
colorsLayer, | ||
offset, | ||
"icon-background", | ||
"cube-icon", | ||
"ball-icon", | ||
"ufo-icon", | ||
"wave-icon", | ||
"robot-icon", | ||
"spider-icon", | ||
"swing-icon", | ||
"cursor-col1", | ||
"cursor-col2", | ||
"cursor-glow", | ||
"glow-label" | ||
); | ||
} | ||
|
||
struct CharacterColorPageIDS : Modify<CharacterColorPageIDS, CharacterColorPage> { | ||
static void onModify(auto& self) { | ||
if (!self.setHookPriority("CharacterColorPage::init", GEODE_ID_PRIORITY)) { | ||
log::warn("Failed to set CharacterColorPage::init hook priority, node IDs may not work properly"); | ||
} | ||
} | ||
|
||
bool init() { | ||
if (!CharacterColorPage::init()) return false; | ||
|
||
NodeIDs::get()->provide(this); | ||
|
||
return true; | ||
} | ||
}; | ||
#endif |