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;
|
auto item = *itemIter;
|
||||||
if (item->listener == listener)
|
if (item->listener == listener)
|
||||||
{
|
{
|
||||||
// FIXME: fixed priority --> scene graph's priority.
|
|
||||||
item->fixedPriority = 0;
|
item->fixedPriority = 0;
|
||||||
item->node = node;
|
item->node = node;
|
||||||
return;
|
return;
|
||||||
|
@ -206,9 +205,12 @@ void EventDispatcher::setPriorityWithFixedValue(EventListener* listener, int fix
|
||||||
auto item = *itemIter;
|
auto item = *itemIter;
|
||||||
if (item->listener == listener)
|
if (item->listener == listener)
|
||||||
{
|
{
|
||||||
// FIXME: scene graph's priority --> fixed priority.
|
|
||||||
item->fixedPriority = fixedPriority;
|
item->fixedPriority = fixedPriority;
|
||||||
item->node = nullptr;
|
if (item->node != nullptr)
|
||||||
|
{
|
||||||
|
item->node->dissociateEventListener(listener);
|
||||||
|
item->node = nullptr;
|
||||||
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue