|
3 | 3 | #include "FileWatcher.hpp" |
4 | 4 | #include "Utils.hpp" |
5 | 5 | #include "nodes/CCLabelBMFont.hpp" |
6 | | -#include "nodes/CCMenuItem.hpp" |
| 6 | +#include "nodes/CCMenuItemSpriteExtra.hpp" |
7 | 7 | #include "nodes/FLAlertLayer.hpp" |
8 | 8 | #include "nodes/CCNode.hpp" |
9 | 9 | #include "UIModding.hpp" |
@@ -906,7 +906,7 @@ void UIModding::setColor(CCNode* node, const matjson::Value& attributes) { |
906 | 906 | std::string colorStr = color.asString().unwrapOr(""); |
907 | 907 |
|
908 | 908 | if (colorStr == "reset") { |
909 | | - if (auto node1 = static_cast<EventCCMenuItem*>(node)) { |
| 909 | + if (auto node1 = static_cast<EventCCMenuItemSpriteExtra*>(typeinfo_cast<CCMenuItemSpriteExtra*>(node))) { |
910 | 910 | auto originalColor = node1->m_fields->originalColor; |
911 | 911 | node1->setColor(originalColor); |
912 | 912 | if (auto buttonNode = node1->getChildByType<ButtonSprite>(0)) { |
@@ -1187,7 +1187,7 @@ void UIModding::setOpacity(CCNode* node, const matjson::Value& attributes) { |
1187 | 1187 | } |
1188 | 1188 |
|
1189 | 1189 | if (opacity.isString() && opacity.asString().unwrapOr("") == "reset") { |
1190 | | - if (auto node1 = static_cast<EventCCMenuItem*>(node)) { |
| 1190 | + if (auto node1 = static_cast<EventCCMenuItemSpriteExtra*>(typeinfo_cast<CCMenuItemSpriteExtra*>(node))) { |
1191 | 1191 | auto original = node1->m_fields->originalOpacity; |
1192 | 1192 | node1->setOpacity(original); |
1193 | 1193 | if (auto node2 = node1->getChildByType<ButtonSprite>(0)) { |
@@ -1444,7 +1444,7 @@ void UIModding::handleAttributes(CCNode* node, const matjson::Value& attributes) |
1444 | 1444 | } |
1445 | 1445 |
|
1446 | 1446 | void UIModding::handleEvent(CCNode* node, const matjson::Value& eventVal) { |
1447 | | - if (EventCCMenuItem* button = static_cast<EventCCMenuItem*>(node)) { |
| 1447 | + if (EventCCMenuItemSpriteExtra* button = static_cast<EventCCMenuItemSpriteExtra*>(typeinfo_cast<CCMenuItemSpriteExtra*>(node))) { |
1448 | 1448 | forEvent(on-click, OnClick); |
1449 | 1449 | forEvent(on-release, OnRelease); |
1450 | 1450 | forEvent(on-activate, OnActivate); |
|
0 commit comments