mirror of https://github.com/axmolengine/axmol.git
[dispatcher] Supporting changing priority from fixed value to node or from node to fixed value.
This commit is contained in:
parent
1b9658f5ad
commit
d940e01bc1
|
@ -185,7 +185,6 @@ void EventDispatcher::setPriorityWithSceneGraph(EventListener* listener, Node* n
|
|||
auto item = *itemIter;
|
||||
if (item->listener == listener)
|
||||
{
|
||||
// FIXME: fixed priority --> scene graph's priority.
|
||||
item->fixedPriority = 0;
|
||||
item->node = node;
|
||||
return;
|
||||
|
@ -206,9 +205,12 @@ void EventDispatcher::setPriorityWithFixedValue(EventListener* listener, int fix
|
|||
auto item = *itemIter;
|
||||
if (item->listener == listener)
|
||||
{
|
||||
// FIXME: scene graph's priority --> fixed priority.
|
||||
item->fixedPriority = fixedPriority;
|
||||
item->node = nullptr;
|
||||
if (item->node != nullptr)
|
||||
{
|
||||
item->node->dissociateEventListener(listener);
|
||||
item->node = nullptr;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue