Skip to content

Commit cd61c18

Browse files
committed
Fix oversight
1 parent 0428000 commit cd61c18

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

changelog.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# 2.0.13
2+
- FIx a really stupid oversight
3+
14
# 2.0.12
25
- Fix sprites on new nodes.
36
- Fix CCMenuItemSpriteExtra content size on new nodes.

mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"mac": "2.2074",
77
"ios": "2.2074"
88
},
9-
"version": "v2.0.12",
9+
"version": "v2.0.13",
1010
"id": "alphalaneous.happy_textures",
1111
"name": "Happy Textures :3",
1212
"developer": "Alphalaneous",

src/nodes/CCMenu.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class $nodeModify(MyCCMenu, cocos2d::CCMenu) {
7878
auto mousePos = getMousePos();
7979
auto local = convertToNodeSpace(mousePos);
8080
for (auto child : CCArrayExt<CCNode*>(getChildren())) {
81-
auto realItem = typeinfo_cast<CCMenuItem*>(child);
81+
auto realItem = typeinfo_cast<CCMenuItemSpriteExtra*>(child);
8282
if (!realItem) continue;
8383
if (EventCCMenuItemSpriteExtra* button = static_cast<EventCCMenuItemSpriteExtra*>(realItem)) {
8484
auto worldPos = button->convertToWorldSpaceAR(CCPointZero);
@@ -89,8 +89,10 @@ class $nodeModify(MyCCMenu, cocos2d::CCMenu) {
8989
#else
9090
auto self = reinterpret_cast<CCMenu*>(this);
9191
if (auto item = self->m_pSelectedItem) {
92-
if (EventCCMenuItemSpriteExtra* button = static_cast<EventCCMenuItemSpriteExtra*>(item)) {
93-
button->checkTouch(!item->isSelected());
92+
auto realItem = typeinfo_cast<CCMenuItemSpriteExtra*>(child);
93+
if (!realItem) continue;
94+
if (EventCCMenuItemSpriteExtra* button = static_cast<EventCCMenuItemSpriteExtra*>(realItem)) {
95+
button->checkTouch(!button->isSelected());
9496
}
9597
}
9698
#endif

0 commit comments

Comments
 (0)