mirror of https://github.com/axmolengine/axmol.git
Merge pull request #3632 from dumganhar/develop
issue #2087: [dispatcher] fixedPriority == 0 is forbidden since it's used for scene graph based priority.
This commit is contained in:
commit
ec57e99d63
|
@ -121,6 +121,7 @@ void EventDispatcher::addEventListenerWithSceneGraphPriority(EventListener* list
|
||||||
void EventDispatcher::addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority)
|
void EventDispatcher::addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority)
|
||||||
{
|
{
|
||||||
CCASSERT(!listener->_isRegistered, "The listener has been registered.");
|
CCASSERT(!listener->_isRegistered, "The listener has been registered.");
|
||||||
|
CCASSERT(fixedPriority != 0, "0 priority is forbidden for fixed priority since it's used for scene graph based priority.");
|
||||||
|
|
||||||
if (!listener->checkAvaiable())
|
if (!listener->checkAvaiable())
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -59,7 +59,7 @@ public:
|
||||||
* @param listener The listener of a specified event.
|
* @param listener The listener of a specified event.
|
||||||
* @param node The priority of the listener is based on the draw order of this node.
|
* @param node The priority of the listener is based on the draw order of this node.
|
||||||
* @note The priority of scene graph will be fixed value 0. So the order of listener item
|
* @note The priority of scene graph will be fixed value 0. So the order of listener item
|
||||||
* in the vector will be ' <0, =0, scene graph, >0'.
|
* in the vector will be ' <0, scene graph (0 priority), >0'.
|
||||||
*/
|
*/
|
||||||
void addEventListenerWithSceneGraphPriority(EventListener* listener, Node* node);
|
void addEventListenerWithSceneGraphPriority(EventListener* listener, Node* node);
|
||||||
|
|
||||||
|
@ -67,6 +67,7 @@ public:
|
||||||
* @param listener The listener of a specified event.
|
* @param listener The listener of a specified event.
|
||||||
* @param fixedPriority The fixed priority of the listener.
|
* @param fixedPriority The fixed priority of the listener.
|
||||||
* @note A lower priority will be called before the ones that have a higher value.
|
* @note A lower priority will be called before the ones that have a higher value.
|
||||||
|
* 0 priority is forbidden for fixed priority since it's used for scene graph based priority.
|
||||||
*/
|
*/
|
||||||
void addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority);
|
void addEventListenerWithFixedPriority(EventListener* listener, int fixedPriority);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue