@@ -34,7 +34,9 @@ class $nodeModify(MyCCMenu, cocos2d::CCMenu) {
3434 bool lastAlert = false ;
3535
3636 if (auto child = getSceneChildContainingNode (node)) {
37+ if (!child) return false ;
3738 for (auto c : CCArrayExt<CCNode*>(child->getChildren ())) {
39+ if (!c) continue ;
3840 if (!AlphaUtils::Cocos::hasNode (node, c)) {
3941 shouldCheck = true ;
4042 }
@@ -56,12 +58,6 @@ class $nodeModify(MyCCMenu, cocos2d::CCMenu) {
5658 auto sceneChild = getSceneChildContainingNode (node);
5759 if (!sceneChild) return false ;
5860
59- if (node->getChildrenCount () == 1 ) {
60- if (typeinfo_cast<ButtonSprite*>(node->getChildren ()->objectAtIndex (0 ))) {
61- return false ;
62- }
63- }
64-
6561 for (auto child : CCArrayExt<CCNode*>(CCScene::get ()->getChildren ())) {
6662 if (child->getZOrder () <= sceneChild->getZOrder ()) continue ;
6763 if (child->boundingBox ().containsPoint (point) && nodeIsVisible (child)) {
@@ -74,6 +70,7 @@ class $nodeModify(MyCCMenu, cocos2d::CCMenu) {
7470 void checkMouse (float ) {
7571 if (!nodeIsVisible (this )) return ;
7672
73+
7774#ifdef GEODE_IS_DESKTOP
7875 auto mousePos = getMousePos ();
7976 auto local = convertToNodeSpace (mousePos);
@@ -92,9 +89,10 @@ class $nodeModify(MyCCMenu, cocos2d::CCMenu) {
9289 auto realItem = typeinfo_cast<CCMenuItemSpriteExtra*>(item);
9390 if (!realItem) return ;
9491 if (EventCCMenuItemSpriteExtra* button = static_cast <EventCCMenuItemSpriteExtra*>(realItem)) {
95- button->checkTouch (!button->isSelected () );
92+ button->checkTouch (!button->m_bSelected );
9693 }
9794 }
9895#endif
9996 }
100- };
97+ };
98+
0 commit comments