diff --git a/bindings/Cocos2d.bro b/bindings/Cocos2d.bro index 0c8dbc67..7152624e 100644 --- a/bindings/Cocos2d.bro +++ b/bindings/Cocos2d.bro @@ -408,12 +408,12 @@ class cocos2d::CCMenu { virtual auto registerWithTouchDispatcher() = mac 0x438cd0, ios 0x131f8c; virtual auto onExit() = mac 0x438bd0, ios 0x131ed4; virtual auto removeChild(cocos2d::CCNode*, bool) = mac 0x438c20, ios 0x15e630; - auto initWithArray(cocos2d::CCArray*) = mac 0x4389f0, ios 0x131d04; - auto itemForTouch(cocos2d::CCTouch*) = mac 0x438dd0; + bool initWithArray(cocos2d::CCArray*) = mac 0x4389f0, ios 0x131d04; + cocos2d::CCMenuItem* itemForTouch(cocos2d::CCTouch*) = mac 0x438dd0; } class cocos2d::CCMenuItem { - auto initWithTarget(cocos2d::CCObject*, cocos2d::SEL_MenuHandler) = mac 0x1fb7f0; + bool initWithTarget(cocos2d::CCObject*, cocos2d::SEL_MenuHandler) = mac 0x1fb7f0; virtual ~CCMenuItem() = mac 0x1fb8e0, ios 0x2cdf4; virtual auto activate() = mac 0x1fba70, ios 0x2ceb0; virtual auto selected() = mac 0x1fb9e0, ios 0x2ce2e; diff --git a/loader/include/Geode/cocos/base_nodes/CCNode.h b/loader/include/Geode/cocos/base_nodes/CCNode.h index c411f2f9..335ea8a6 100644 --- a/loader/include/Geode/cocos/base_nodes/CCNode.h +++ b/loader/include/Geode/cocos/base_nodes/CCNode.h @@ -990,13 +990,24 @@ public: GEODE_DLL void swapChildIndices(CCNode* first, CCNode* second); template - geode::EventListenerProtocol* addEventListener(typename Filter::Callback callback, Args&&... args) { + geode::EventListenerProtocol* addEventListener( + geode::utils::MiniFunction callback, Args&&... args + ) { auto listener = new geode::EventListener( callback, Filter(this, std::forward(args)...) ); this->addEventListenerInternal(listener); return listener; } + template + geode::EventListenerProtocol* addEventListener( + geode::utils::MiniFunction callback, + Args&&... args + ) { + return this->template addEventListener( + callback, std::forward(args)... + ); + } GEODE_DLL void removeEventListener(geode::EventListenerProtocol* listener); /// @{ diff --git a/loader/include/Geode/loader/Event.hpp b/loader/include/Geode/loader/Event.hpp index 8dfc33c0..91c2a341 100644 --- a/loader/include/Geode/loader/Event.hpp +++ b/loader/include/Geode/loader/Event.hpp @@ -120,6 +120,10 @@ namespace geode { m_filter = filter; } + T getFilter() const { + return m_filter; + } + protected: utils::MiniFunction m_callback = nullptr; T m_filter;