Skip to content
This repository was archived by the owner on Aug 2, 2026. It is now read-only.

Commit e24948d

Browse files
committed
Remove hooks I no longer need
1 parent 80672f1 commit e24948d

6 files changed

Lines changed: 21 additions & 254 deletions

File tree

src/HPTCCNode.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,10 @@ class $modify(HPTCCNode, CCNode) {
5050
void enableTouch() {
5151
auto fields = m_fields.self();
5252
if (!fields->m_touchObject) {
53+
if (auto nodeRGBA = typeinfo_cast<CCNodeRGBA*>(this)) {
54+
nodeRGBA->setUserObject("orig-color"_spr, ObjWrapper<ccColor3B>::create(nodeRGBA->getColor()));
55+
nodeRGBA->setUserObject("orig-opacity"_spr, CCInteger::create(nodeRGBA->getOpacity()));
56+
}
5357
fields->m_touchObject = TouchObject::create(this);
5458
addChild(fields->m_touchObject);
5559
}

src/NodeModding.hpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ class $modify(CCDictionary) {
3030
}
3131
};
3232

33-
3433
class $modify(HTCCObject, CCObject) {
3534

3635
CCObject* autorelease() {
@@ -54,7 +53,6 @@ class $modify(HTCCObject, CCObject) {
5453
}
5554
};
5655

57-
5856
class $modify(CCPoolManager) {
5957
void pop() {
6058
LateQueue::get()->executeQueue();

src/UIModding.cpp

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
#include "FileWatcher.hpp"
44
#include "Utils.hpp"
55
#include "nodes/CCLabelBMFont.hpp"
6-
#include "nodes/CCMenuItemSpriteExtra.hpp"
76
#include "nodes/FLAlertLayer.hpp"
87
#include "nodes/CCNode.hpp"
98
#include "UIModding.hpp"
@@ -579,11 +578,13 @@ void UIModding::setColor(CCNode* node, const matjson::Value& attributes) {
579578
std::string colorStr = color.asString().unwrapOr("");
580579

581580
if (colorStr == "reset") {
582-
if (auto node1 = static_cast<EventCCMenuItemSpriteExtra*>(typeinfo_cast<CCMenuItemSpriteExtra*>(node))) {
583-
auto originalColor = node1->m_fields->originalColor;
584-
node1->setColor(originalColor);
585-
if (auto buttonNode = node1->getChildByType<ButtonSprite>(0)) {
586-
buttonNode->setColor(originalColor);
581+
if (auto node1 = typeinfo_cast<CCNodeRGBA*>(node)) {
582+
if (auto color = static_cast<ObjWrapper<ccColor3B>*>(node1->getUserObject("orig-color"_spr))) {
583+
auto originalColor = color->getValue();
584+
node1->setColor(originalColor);
585+
if (auto buttonNode = node1->getChildByType<ButtonSprite>(0)) {
586+
buttonNode->setColor(originalColor);
587+
}
587588
}
588589
}
589590
}
@@ -840,11 +841,13 @@ void UIModding::setOpacity(CCNode* node, const matjson::Value& attributes) {
840841
}
841842

842843
if (opacity.isString() && opacity.asString().unwrapOr("") == "reset") {
843-
if (auto node1 = static_cast<EventCCMenuItemSpriteExtra*>(typeinfo_cast<CCMenuItemSpriteExtra*>(node))) {
844-
auto original = node1->m_fields->originalOpacity;
845-
node1->setOpacity(original);
846-
if (auto node2 = node1->getChildByType<ButtonSprite>(0)) {
847-
node2->setOpacity(original);
844+
if (auto node1 = typeinfo_cast<CCNodeRGBA*>(node)) {
845+
if (auto opacity = static_cast<CCInteger*>(node1->getUserObject("orig-opacity"_spr))) {
846+
auto originalOpacity = opacity->getValue();
847+
node1->setOpacity(originalOpacity);
848+
if (auto buttonNode = node1->getChildByType<ButtonSprite>(0)) {
849+
buttonNode->setOpacity(originalOpacity);
850+
}
848851
}
849852
}
850853
}
@@ -1415,9 +1418,10 @@ void UIModding::handleModifications(CCNode* node, matjson::Value nodeObject, boo
14151418

14161419
void UIModding::reloadChildren(CCNode* parentNode, bool transition) {
14171420
if (!parentNode) return;
1421+
if (!checkNodeValidity(parentNode)) return;
1422+
14181423
MyCCNode* myParentNode = static_cast<MyCCNode*>(parentNode);
1419-
if (!checkNodeValidity(myParentNode)) return;
1420-
1424+
14211425
for (const matjson::Value& value : myParentNode->getAttributes()) {
14221426
handleModifications(myParentNode, value, transition);
14231427
}

src/main.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
#include <Geode/Geode.hpp>
22
#include "Macros.hpp"
33
#include "nodes/CCLabelBMFont.hpp"
4-
#include "nodes/CCMenu.hpp"
5-
#include "nodes/CCMenuItemSpriteExtra.hpp"
64
#include "nodes/CCScale9Sprite.hpp"
75
#include "nodes/EditLevelLayer.hpp"
86
#include "nodes/GJCommentListLayer.hpp"

src/nodes/CCMenu.hpp

Lines changed: 0 additions & 89 deletions
This file was deleted.

src/nodes/CCMenuItemSpriteExtra.hpp

Lines changed: 0 additions & 148 deletions
This file was deleted.

0 commit comments

Comments
 (0)