git rid of _mouseToOverlays until I remember why I thought I needed it

This commit is contained in:
Seth Alves 2017-02-27 11:11:04 -08:00
parent 1864975c51
commit 8110921abf
2 changed files with 12 additions and 28 deletions

View file

@ -3104,23 +3104,18 @@ void Application::mouseMoveEvent(QMouseEvent* event) {
if (compositor.getReticleVisible() || !isHMDMode() || !compositor.getReticleOverDesktop() || if (compositor.getReticleVisible() || !isHMDMode() || !compositor.getReticleOverDesktop() ||
getOverlays().getOverlayAtPoint(glm::vec2(transformedPos.x(), transformedPos.y())) != UNKNOWN_OVERLAY_ID) { getOverlays().getOverlayAtPoint(glm::vec2(transformedPos.x(), transformedPos.y())) != UNKNOWN_OVERLAY_ID) {
if (_mouseToOverlays) { getOverlays().mouseMoveEvent(&mappedEvent);
getOverlays().mouseMoveEvent(&mappedEvent); getEntities()->mouseMoveEvent(&mappedEvent);
} else {
getEntities()->mouseMoveEvent(&mappedEvent);
}
} }
if (!_mouseToOverlays) { _controllerScriptingInterface->emitMouseMoveEvent(&mappedEvent); // send events to any registered scripts
_controllerScriptingInterface->emitMouseMoveEvent(&mappedEvent); // send events to any registered scripts
}
// if one of our scripts have asked to capture this event, then stop processing it // if one of our scripts have asked to capture this event, then stop processing it
if (_controllerScriptingInterface->isMouseCaptured()) { if (_controllerScriptingInterface->isMouseCaptured()) {
return; return;
} }
if (!_mouseToOverlays && _keyboardMouseDevice->isActive()) { if (_keyboardMouseDevice->isActive()) {
_keyboardMouseDevice->mouseMoveEvent(event); _keyboardMouseDevice->mouseMoveEvent(event);
} }
} }
@ -3128,7 +3123,6 @@ void Application::mouseMoveEvent(QMouseEvent* event) {
void Application::mousePressEvent(QMouseEvent* event) { void Application::mousePressEvent(QMouseEvent* event) {
// Inhibit the menu if the user is using alt-mouse dragging // Inhibit the menu if the user is using alt-mouse dragging
_altPressed = false; _altPressed = false;
_mouseToOverlays = false;
auto offscreenUi = DependencyManager::get<OffscreenUi>(); auto offscreenUi = DependencyManager::get<OffscreenUi>();
// If we get a mouse press event it means it wasn't consumed by the offscreen UI, // If we get a mouse press event it means it wasn't consumed by the offscreen UI,
@ -3145,23 +3139,20 @@ void Application::mousePressEvent(QMouseEvent* event) {
event->buttons(), event->modifiers()); event->buttons(), event->modifiers());
if (!_aboutToQuit) { if (!_aboutToQuit) {
if (getOverlays().mousePressEvent(&mappedEvent)) { getOverlays().mousePressEvent(&mappedEvent);
_mouseToOverlays = true; if (!_controllerScriptingInterface->areEntityClicksCaptured()) {
} else if (!_controllerScriptingInterface->areEntityClicksCaptured()) {
getEntities()->mousePressEvent(&mappedEvent); getEntities()->mousePressEvent(&mappedEvent);
} }
} }
if (!_mouseToOverlays) { _controllerScriptingInterface->emitMousePressEvent(&mappedEvent); // send events to any registered scripts
_controllerScriptingInterface->emitMousePressEvent(&mappedEvent); // send events to any registered scripts
}
// if one of our scripts have asked to capture this event, then stop processing it // if one of our scripts have asked to capture this event, then stop processing it
if (_controllerScriptingInterface->isMouseCaptured()) { if (_controllerScriptingInterface->isMouseCaptured()) {
return; return;
} }
if (!_mouseToOverlays && hasFocus()) { if (hasFocus()) {
if (_keyboardMouseDevice->isActive()) { if (_keyboardMouseDevice->isActive()) {
_keyboardMouseDevice->mousePressEvent(event); _keyboardMouseDevice->mousePressEvent(event);
} }
@ -3195,23 +3186,18 @@ void Application::mouseReleaseEvent(QMouseEvent* event) {
event->buttons(), event->modifiers()); event->buttons(), event->modifiers());
if (!_aboutToQuit) { if (!_aboutToQuit) {
if (_mouseToOverlays) { getOverlays().mouseReleaseEvent(&mappedEvent);
getOverlays().mouseReleaseEvent(&mappedEvent); getEntities()->mouseReleaseEvent(&mappedEvent);
} else {
getEntities()->mouseReleaseEvent(&mappedEvent);
}
} }
if (!_mouseToOverlays) { _controllerScriptingInterface->emitMouseReleaseEvent(&mappedEvent); // send events to any registered scripts
_controllerScriptingInterface->emitMouseReleaseEvent(&mappedEvent); // send events to any registered scripts
}
// if one of our scripts have asked to capture this event, then stop processing it // if one of our scripts have asked to capture this event, then stop processing it
if (_controllerScriptingInterface->isMouseCaptured()) { if (_controllerScriptingInterface->isMouseCaptured()) {
return; return;
} }
if (!_mouseToOverlays && hasFocus()) { if (hasFocus()) {
if (_keyboardMouseDevice->isActive()) { if (_keyboardMouseDevice->isActive()) {
_keyboardMouseDevice->mouseReleaseEvent(event); _keyboardMouseDevice->mouseReleaseEvent(event);
} }

View file

@ -676,8 +676,6 @@ private:
void addAssetToWorldInfoDone(QString modelName); void addAssetToWorldInfoDone(QString modelName);
void addAssetToWorldError(QString modelName, QString errorText); void addAssetToWorldError(QString modelName, QString errorText);
bool _mouseToOverlays { false };
QQuickItem* _addAssetToWorldMessageBox{ nullptr }; QQuickItem* _addAssetToWorldMessageBox{ nullptr };
QStringList _addAssetToWorldInfoKeys; // Model name QStringList _addAssetToWorldInfoKeys; // Model name
QStringList _addAssetToWorldInfoMessages; // Info message QStringList _addAssetToWorldInfoMessages; // Info message