diff --git a/examples/editEntities.js b/examples/editEntities.js index 5c26fc0805..3a70d2020e 100644 --- a/examples/editEntities.js +++ b/examples/editEntities.js @@ -60,6 +60,7 @@ selectionManager.addEventListener(function() { propertiesTool.setVisible(true); entityListTool.setVisible(true); gridTool.setVisible(true); + Window.setFocus(); hasShownPropertiesTool = true; } if (!selectionManager.hasSelection()) { @@ -534,7 +535,7 @@ function mousePressEvent(event) { if (result !== null) { var currentProperties = Entities.getEntityProperties(result.entityID); cameraManager.enable(); - cameraManager.focus(currentProperties.position, null, Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); + cameraManager.focus(currentProperties.position, null, true); cameraManager.mousePressEvent(event); } } else { @@ -670,19 +671,19 @@ function mouseClickEvent(event) { orientation = MyAvatar.orientation; intersection = rayPlaneIntersection(pickRay, P, Quat.getFront(orientation)); - if (!event.isShifted) { - selectionManager.clearSelections(); - } - var toggle = event.isShifted; - selectionManager.addEntity(foundEntity, toggle); + if (!event.isShifted) { + selectionManager.setSelections([foundEntity]); + } else { + selectionManager.addEntity(foundEntity, true); + } print("Model selected: " + foundEntity.id); selectionDisplay.select(selectedEntityID, event); cameraManager.focus(selectionManager.worldPosition, selectionManager.worldDimensions, - Menu.isOptionChecked(MENU_EASE_ON_FOCUS)); + true); } } } @@ -820,9 +821,7 @@ function handeMenuEvent(menuItem) { } else if (menuItem == "Import Models") { modelImporter.doImport(); } else if (menuItem == "Entity List...") { - if (isActive) { - entityListTool.toggleVisible(); - } + entityListTool.toggleVisible(); } tooltip.show(false); } diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index d572ef1ad4..a671325e39 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -559,13 +559,6 @@
-
Mass
-
- -
-
- -
Density
diff --git a/interface/src/scripting/WindowScriptingInterface.cpp b/interface/src/scripting/WindowScriptingInterface.cpp index cffa5f777f..90ddade472 100644 --- a/interface/src/scripting/WindowScriptingInterface.cpp +++ b/interface/src/scripting/WindowScriptingInterface.cpp @@ -44,6 +44,11 @@ QScriptValue WindowScriptingInterface::hasFocus() { return DependencyManager::get()->hasFocus(); } +void WindowScriptingInterface::setFocus() { + Application::getInstance()->getWindow()->activateWindow(); + Application::getInstance()->getWindow()->setFocus(); +} + void WindowScriptingInterface::setCursorVisible(bool visible) { Application::getInstance()->setCursorVisible(visible); } diff --git a/interface/src/scripting/WindowScriptingInterface.h b/interface/src/scripting/WindowScriptingInterface.h index 05411530df..79a23960c9 100644 --- a/interface/src/scripting/WindowScriptingInterface.h +++ b/interface/src/scripting/WindowScriptingInterface.h @@ -40,6 +40,7 @@ public slots: void setCursorPosition(int x, int y); void setCursorVisible(bool visible); QScriptValue hasFocus(); + void setFocus(); QScriptValue alert(const QString& message = ""); QScriptValue confirm(const QString& message = ""); QScriptValue form(const QString& title, QScriptValue array);