mirror of https://github.com/axmolengine/axmol.git
issue #2087: Small improvement in Node::removeAllEventListeners. Adding Node::_oldEventPriority property.
This commit is contained in:
parent
3a5a1e6604
commit
241c0c8efc
|
@ -126,6 +126,8 @@ Node::Node(void)
|
||||||
, _isTransitionFinished(false)
|
, _isTransitionFinished(false)
|
||||||
, _updateScriptHandler(0)
|
, _updateScriptHandler(0)
|
||||||
, _componentContainer(NULL)
|
, _componentContainer(NULL)
|
||||||
|
, _eventPriority(0)
|
||||||
|
, _oldEventPriority(0)
|
||||||
{
|
{
|
||||||
// set default scheduler and actionManager
|
// set default scheduler and actionManager
|
||||||
Director *director = Director::getInstance();
|
Director *director = Director::getInstance();
|
||||||
|
@ -1307,9 +1309,11 @@ void Node::dissociateEventListener(EventListener* listener)
|
||||||
|
|
||||||
void Node::removeAllEventListeners()
|
void Node::removeAllEventListeners()
|
||||||
{
|
{
|
||||||
|
auto dispatcher = EventDispatcher::getInstance();
|
||||||
|
|
||||||
for (auto& listener : _eventlisteners)
|
for (auto& listener : _eventlisteners)
|
||||||
{
|
{
|
||||||
EventDispatcher::getInstance()->removeEventListener(listener);
|
dispatcher->removeEventListener(listener);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1464,8 +1464,9 @@ protected:
|
||||||
|
|
||||||
ComponentContainer *_componentContainer; ///< Dictionary of components
|
ComponentContainer *_componentContainer; ///< Dictionary of components
|
||||||
|
|
||||||
int _eventPriority;
|
int _eventPriority; ///< The scene graph based priority of event listener.
|
||||||
static int _globalEventPriorityIndex;
|
int _oldEventPriority; ///< The old scene graph based priority of event listener.
|
||||||
|
static int _globalEventPriorityIndex; ///< The index of global event priority.
|
||||||
};
|
};
|
||||||
|
|
||||||
//#pragma mark - NodeRGBA
|
//#pragma mark - NodeRGBA
|
||||||
|
|
Loading…
Reference in New Issue