Merge remote-tracking branch 'highfidelity/master' into 20901

This commit is contained in:
Geenz 2016-05-19 20:57:31 -04:00
commit e2f5d22c98
5 changed files with 55 additions and 5 deletions

View file

@ -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

View file

@ -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);

View file

@ -97,7 +97,7 @@ namespace Setting {
}
void Interface::deinit() {
if (privateInstance) {
if (_isInitialized && privateInstance) {
// Save value to disk
save();

View file

@ -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;
}

View file

@ -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);