Showing the changes to libraries/entities/src/EntityScriptingInterface.cpp (1 of 9 files). Show all
Unified · Split
| @@ -1624,43 +1624,46 @@ QUuid EntityScriptingInterface::getKeyboardFocusEntity() const { · 1623 unmodified lines | ||
| 1624 | 1624 | } |
| 1625 | 1625 | |
| 1626 | 1626 | void EntityScriptingInterface::setKeyboardFocusEntity(QUuid id) { |
| 1627 | − QMetaObject::invokeMethod(qApp, "setKeyboardFocusEntity", Qt::QueuedConnection, Q_ARG(QUuid, id)); | |
| 1627 | + QMetaObject::invokeMethod(qApp, "setKeyboardFocusEntity", Qt::DirectConnection, Q_ARG(EntityItemID, id)); | |
| 1628 | 1628 | } |
| 1629 | 1629 | |
| 1630 | −void EntityScriptingInterface::sendMousePressOnEntity(QUuid id, PointerEvent event) { | |
| 1631 | − QMetaObject::invokeMethod(qApp, "sendMousePressOnEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1630 | +// FIXME: the following methods need to be calling EntityTreeRenderer::mouseXXX methods | |
| 1631 | +// Otherwise, like right now, they will not trigger entity script callbacks | |
| 1632 | +// They should still work on web entities and with Interface script event handlers | |
| 1633 | +void EntityScriptingInterface::sendMousePressOnEntity(EntityItemID id, PointerEvent event) { | |
| 1634 | + emit DependencyManager::get<EntityScriptingInterface>()->mousePressOnEntity(id, event); | |
| 1632 | 1635 | } |
| 1633 | 1636 | |
| 1634 | −void EntityScriptingInterface::sendMouseMoveOnEntity(QUuid id, PointerEvent event) { | |
| 1635 | − QMetaObject::invokeMethod(qApp, "sendMouseMoveOnEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1637 | +void EntityScriptingInterface::sendMouseMoveOnEntity(EntityItemID id, PointerEvent event) { | |
| 1638 | + emit DependencyManager::get<EntityScriptingInterface>()->mouseMoveOnEntity(id, event); | |
| 1636 | 1639 | } |
| 1637 | 1640 | |
| 1638 | −void EntityScriptingInterface::sendMouseReleaseOnEntity(QUuid id, PointerEvent event) { | |
| 1639 | − QMetaObject::invokeMethod(qApp, "sendMouseReleaseOnEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1641 | +void EntityScriptingInterface::sendMouseReleaseOnEntity(EntityItemID id, PointerEvent event) { | |
| 1642 | + emit DependencyManager::get<EntityScriptingInterface>()->mouseReleaseOnEntity(id, event); | |
| 1640 | 1643 | } |
| 1641 | 1644 | |
| 1642 | −void EntityScriptingInterface::sendClickDownOnEntity(QUuid id, PointerEvent event) { | |
| 1643 | − QMetaObject::invokeMethod(qApp, "sendClickDownOnEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1645 | +void EntityScriptingInterface::sendClickDownOnEntity(EntityItemID id, PointerEvent event) { | |
| 1646 | + emit DependencyManager::get<EntityScriptingInterface>()->clickDownOnEntity(id, event); | |
| 1644 | 1647 | } |
| 1645 | 1648 | |
| 1646 | −void EntityScriptingInterface::sendHoldingClickOnEntity(QUuid id, PointerEvent event) { | |
| 1647 | − QMetaObject::invokeMethod(qApp, "sendHoldingClickOnEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1649 | +void EntityScriptingInterface::sendHoldingClickOnEntity(EntityItemID id, PointerEvent event) { | |
| 1650 | + emit DependencyManager::get<EntityScriptingInterface>()->holdingClickOnEntity(id, event); | |
| 1648 | 1651 | } |
| 1649 | 1652 | |
| 1650 | −void EntityScriptingInterface::sendClickReleaseOnEntity(QUuid id, PointerEvent event) { | |
| 1651 | − QMetaObject::invokeMethod(qApp, "sendClickReleaseOnEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1653 | +void EntityScriptingInterface::sendClickReleaseOnEntity(EntityItemID id, PointerEvent event) { | |
| 1654 | + emit DependencyManager::get<EntityScriptingInterface>()->clickReleaseOnEntity(id, event); | |
| 1652 | 1655 | } |
| 1653 | 1656 | |
| 1654 | −void EntityScriptingInterface::sendHoverEnterEntity(QUuid id, PointerEvent event) { | |
| 1655 | − QMetaObject::invokeMethod(qApp, "sendHoverEnterEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1657 | +void EntityScriptingInterface::sendHoverEnterEntity(EntityItemID id, PointerEvent event) { | |
| 1658 | + emit DependencyManager::get<EntityScriptingInterface>()->hoverEnterEntity(id, event); | |
| 1656 | 1659 | } |
| 1657 | 1660 | |
| 1658 | −void EntityScriptingInterface::sendHoverOverEntity(QUuid id, PointerEvent event) { | |
| 1659 | − QMetaObject::invokeMethod(qApp, "sendHoverOverEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1661 | +void EntityScriptingInterface::sendHoverOverEntity(EntityItemID id, PointerEvent event) { | |
| 1662 | + emit DependencyManager::get<EntityScriptingInterface>()->hoverOverEntity(id, event); | |
| 1660 | 1663 | } |
| 1661 | 1664 | |
| 1662 | −void EntityScriptingInterface::sendHoverLeaveEntity(QUuid id, PointerEvent event) { | |
| 1663 | − QMetaObject::invokeMethod(qApp, "sendHoverLeaveEntity", Qt::QueuedConnection, Q_ARG(QUuid, id), Q_ARG(PointerEvent, event)); | |
| 1665 | +void EntityScriptingInterface::sendHoverLeaveEntity(EntityItemID id, PointerEvent event) { | |
| 1666 | + emit DependencyManager::get<EntityScriptingInterface>()->hoverLeaveEntity(id, event); | |
| 1664 | 1667 | } |
| 1665 | 1668 | |
| 1666 | 1669 | bool EntityScriptingInterface::wantsHandControllerPointerEvents(QUuid id) { |