diff --git a/libraries/entities/src/EntityTree.cpp b/libraries/entities/src/EntityTree.cpp index 30c37d46b1..97d4e91acd 100644 --- a/libraries/entities/src/EntityTree.cpp +++ b/libraries/entities/src/EntityTree.cpp @@ -1376,6 +1376,10 @@ bool EntityTree::sendEntitiesOperation(OctreeElementPointer element, void* extra item->globalizeProperties(properties, "Cannot find %3 parent of %2 %1", args->root); } } + + // set creation time to "now" for imported entities + properties.setCreated(usecTimestampNow()); + properties.markAllChanged(); // so the entire property set is considered new, since we're making a new entity // queue the packet to send to the server diff --git a/libraries/script-engine/src/ScriptEngines.cpp b/libraries/script-engine/src/ScriptEngines.cpp index 70eb055d22..4fd680025a 100644 --- a/libraries/script-engine/src/ScriptEngines.cpp +++ b/libraries/script-engine/src/ScriptEngines.cpp @@ -256,7 +256,7 @@ QVariantList ScriptEngines::getRunning() { } -static const QString SETTINGS_KEY = "Settings"; +static const QString SETTINGS_KEY = "RunningScripts"; void ScriptEngines::loadDefaultScripts() { QUrl defaultScriptsLoc = defaultScriptsLocation(); @@ -281,6 +281,43 @@ void ScriptEngines::loadScripts() { // loads all saved scripts Settings settings; + + + // START of backward compatibility code + // This following if statement is only meant to update the settings file still using the old setting key. + // If you read that comment and it has been more than a couple months since it was merged, + // then by all means, feel free to remove it. + if (!settings.childGroups().contains(SETTINGS_KEY)) { + qWarning() << "Detected old script settings config, loading from previous location"; + const QString oldKey = "Settings"; + + // Load old scripts array from settings + int size = settings.beginReadArray(oldKey); + for (int i = 0; i < size; ++i) { + settings.setArrayIndex(i); + QString string = settings.value("script").toString(); + if (!string.isEmpty()) { + loadScript(string); + } + } + settings.endArray(); + + // Cleanup old scripts array from settings + settings.beginWriteArray(oldKey); + for (int i = 0; i < size; ++i) { + settings.setArrayIndex(i); + settings.remove(""); + } + settings.endArray(); + settings.beginGroup(oldKey); + settings.remove("size"); + settings.endGroup(); + + return; + } + // END of backward compatibility code + + int size = settings.beginReadArray(SETTINGS_KEY); for (int i = 0; i < size; ++i) { settings.setArrayIndex(i); diff --git a/libraries/shared/src/SettingInterface.cpp b/libraries/shared/src/SettingInterface.cpp index 6c5431a13e..a931875771 100644 --- a/libraries/shared/src/SettingInterface.cpp +++ b/libraries/shared/src/SettingInterface.cpp @@ -97,7 +97,7 @@ namespace Setting { } void Interface::deinit() { - if (privateInstance) { + if (_isInitialized && privateInstance) { // Save value to disk save(); diff --git a/scripts/system/controllers/grab.js b/scripts/system/controllers/grab.js index a7e08451bc..ef39e95880 100644 --- a/scripts/system/controllers/grab.js +++ b/scripts/system/controllers/grab.js @@ -316,7 +316,12 @@ Grabber.prototype.pressEvent = function(event) { return; } - if (event.isLeftButton!==true ||event.isRightButton===true || event.isMiddleButton===true) { + if (event.isLeftButton !== true || event.isRightButton === true || event.isMiddleButton === true) { + return; + } + + if (Overlays.getOverlayAtPoint(Reticle.position) > 0) { + // the mouse is pointing at an overlay; don't look for entities underneath the overlay. return; } diff --git a/scripts/system/controllers/handControllerPointer.js b/scripts/system/controllers/handControllerPointer.js index 921c55b7b2..78b7c4eb84 100644 --- a/scripts/system/controllers/handControllerPointer.js +++ b/scripts/system/controllers/handControllerPointer.js @@ -186,7 +186,9 @@ function updateSeeking() { averageMouseVelocity = lastIntegration = 0; var lookAt2D = HMD.getHUDLookAtPosition2D(); if (!lookAt2D) { - print('Cannot seek without lookAt position'); + // FIXME - determine if this message is useful but make it so it doesn't spam the + // log in the case that it is happening + //print('Cannot seek without lookAt position'); return; } // E.g., if parallel to location in HUD var copy = Reticle.position; @@ -420,7 +422,9 @@ function update() { var hudPoint3d = calculateRayUICollisionPoint(controllerPosition, controllerDirection); if (!hudPoint3d) { - print('Controller is parallel to HUD'); + // FIXME - determine if this message is useful but make it so it doesn't spam the + // log in the case that it is happening + //print('Controller is parallel to HUD'); return turnOffVisualization(); } var hudPoint2d = overlayFromWorldPoint(hudPoint3d);