mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-05-29 09:51:33 +02:00
ignoring entities in interstitial/saving address on 404 error
This commit is contained in:
parent
f875bfd0d8
commit
d6af09ca62
5 changed files with 50 additions and 4 deletions
|
@ -161,8 +161,14 @@ void AddressManager::storeCurrentAddress() {
|
||||||
// be loaded over http(s)
|
// be loaded over http(s)
|
||||||
// url.scheme() == URL_SCHEME_HTTP ||
|
// url.scheme() == URL_SCHEME_HTTP ||
|
||||||
// url.scheme() == URL_SCHEME_HTTPS ||
|
// url.scheme() == URL_SCHEME_HTTPS ||
|
||||||
|
bool isInErrorState = DependencyManager::get<NodeList>()->getDomainHandler().isInErrorState();
|
||||||
if (isConnected()) {
|
if (isConnected()) {
|
||||||
currentAddressHandle.set(url);
|
if (isInErrorState) {
|
||||||
|
// save the last address visited before the problem url.
|
||||||
|
currentAddressHandle.set(lastAddress());
|
||||||
|
} else {
|
||||||
|
currentAddressHandle.set(url);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
qCWarning(networking) << "Ignoring attempt to save current address because not connected to domain:" << url;
|
qCWarning(networking) << "Ignoring attempt to save current address because not connected to domain:" << url;
|
||||||
}
|
}
|
||||||
|
@ -861,6 +867,10 @@ void AddressManager::goToUser(const QString& username, bool shouldMatchOrientati
|
||||||
QByteArray(), nullptr, requestParams);
|
QByteArray(), nullptr, requestParams);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool AddressManager::canGoBack() const {
|
||||||
|
return (_backStack.size() > 0);
|
||||||
|
}
|
||||||
|
|
||||||
void AddressManager::refreshPreviousLookup() {
|
void AddressManager::refreshPreviousLookup() {
|
||||||
// if we have a non-empty previous lookup, fire it again now (but don't re-store it in the history)
|
// if we have a non-empty previous lookup, fire it again now (but don't re-store it in the history)
|
||||||
if (!_previousAPILookup.isEmpty()) {
|
if (!_previousAPILookup.isEmpty()) {
|
||||||
|
|
|
@ -254,6 +254,12 @@ public slots:
|
||||||
*/
|
*/
|
||||||
void goToLastAddress() { handleUrl(_lastVisitedURL, LookupTrigger::AttemptedRefresh); }
|
void goToLastAddress() { handleUrl(_lastVisitedURL, LookupTrigger::AttemptedRefresh); }
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Returns if going back is possible.
|
||||||
|
* @function location.canGoBack
|
||||||
|
*/
|
||||||
|
bool canGoBack() const;
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Refresh the current address, e.g., after connecting to a domain in order to position the user to the desired location.
|
* Refresh the current address, e.g., after connecting to a domain in order to position the user to the desired location.
|
||||||
* @function location.refreshPreviousLookup
|
* @function location.refreshPreviousLookup
|
||||||
|
|
|
@ -110,6 +110,8 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
this.reticleMinY = MARGIN;
|
this.reticleMinY = MARGIN;
|
||||||
this.reticleMaxY;
|
this.reticleMaxY;
|
||||||
|
|
||||||
|
this.ignoredEntities = [];
|
||||||
|
|
||||||
var ACTION_TTL = 15; // seconds
|
var ACTION_TTL = 15; // seconds
|
||||||
|
|
||||||
var DISTANCE_HOLDING_RADIUS_FACTOR = 3.5; // multiplied by distance between hand and object
|
var DISTANCE_HOLDING_RADIUS_FACTOR = 3.5; // multiplied by distance between hand and object
|
||||||
|
@ -314,6 +316,17 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
return point2d;
|
return point2d;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.restoreIgnoredEntities = function() {
|
||||||
|
for (var i = 0; i < this.ignoredEntities; i++) {
|
||||||
|
var data = {
|
||||||
|
action: 'remove',
|
||||||
|
id: this.ignoredEntities[i]
|
||||||
|
};
|
||||||
|
Messages.sendMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data));
|
||||||
|
}
|
||||||
|
this.ignoredEntities = [];
|
||||||
|
};
|
||||||
|
|
||||||
this.notPointingAtEntity = function(controllerData) {
|
this.notPointingAtEntity = function(controllerData) {
|
||||||
var intersection = controllerData.rayPicks[this.hand];
|
var intersection = controllerData.rayPicks[this.hand];
|
||||||
var entityProperty = Entities.getEntityProperties(intersection.objectID);
|
var entityProperty = Entities.getEntityProperties(intersection.objectID);
|
||||||
|
@ -323,6 +336,15 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") ||
|
if ((intersection.type === Picks.INTERSECTED_ENTITY && entityType === "Web") ||
|
||||||
intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) {
|
intersection.type === Picks.INTERSECTED_OVERLAY || Window.isPointOnDesktopWindow(point2d)) {
|
||||||
return true;
|
return true;
|
||||||
|
} else if (intersection.type === Picks.INTERSECTED_ENTITY && !Window.isPhysicsEnabled()) {
|
||||||
|
// add to ignored items.
|
||||||
|
var data = {
|
||||||
|
action: 'add',
|
||||||
|
id: intersection.objectID
|
||||||
|
};
|
||||||
|
Messages.sendMessage('Hifi-Hand-RayPick-Blacklist', JSON.stringify(data));
|
||||||
|
this.ignoredEntities.push(intersection.objectID);
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
@ -383,6 +405,7 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
this.isReady = function (controllerData) {
|
this.isReady = function (controllerData) {
|
||||||
if (HMD.active) {
|
if (HMD.active) {
|
||||||
if (this.notPointingAtEntity(controllerData)) {
|
if (this.notPointingAtEntity(controllerData)) {
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -394,9 +417,11 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
return makeRunningValues(true, [], []);
|
return makeRunningValues(true, [], []);
|
||||||
} else {
|
} else {
|
||||||
this.destroyContextOverlay();
|
this.destroyContextOverlay();
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -407,6 +432,7 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
Selection.removeFromSelectedItemsList(DISPATCHER_HOVERING_LIST, "entity",
|
Selection.removeFromSelectedItemsList(DISPATCHER_HOVERING_LIST, "entity",
|
||||||
this.highlightedEntity);
|
this.highlightedEntity);
|
||||||
this.highlightedEntity = null;
|
this.highlightedEntity = null;
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
this.intersectionDistance = controllerData.rayPicks[this.hand].distance;
|
this.intersectionDistance = controllerData.rayPicks[this.hand].distance;
|
||||||
|
@ -437,6 +463,7 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
if (nearGrabReadiness[k].active && (nearGrabReadiness[k].targets[0] === this.grabbedThingID
|
if (nearGrabReadiness[k].active && (nearGrabReadiness[k].targets[0] === this.grabbedThingID
|
||||||
|| HMD.tabletID && nearGrabReadiness[k].targets[0] === HMD.tabletID)) {
|
|| HMD.tabletID && nearGrabReadiness[k].targets[0] === HMD.tabletID)) {
|
||||||
this.endFarGrabAction();
|
this.endFarGrabAction();
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -448,6 +475,7 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
for (var j = 0; j < nearGrabReadiness.length; j++) {
|
for (var j = 0; j < nearGrabReadiness.length; j++) {
|
||||||
if (nearGrabReadiness[j].active) {
|
if (nearGrabReadiness[j].active) {
|
||||||
this.endFarGrabAction();
|
this.endFarGrabAction();
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -466,6 +494,7 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
]);
|
]);
|
||||||
if (targetProps.href !== "") {
|
if (targetProps.href !== "") {
|
||||||
AddressManager.handleLookupString(targetProps.href);
|
AddressManager.handleLookupString(targetProps.href);
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -583,6 +612,7 @@ Script.include("/~/system/libraries/Xform.js");
|
||||||
Selection.removeFromSelectedItemsList(DISPATCHER_HOVERING_LIST, "entity",
|
Selection.removeFromSelectedItemsList(DISPATCHER_HOVERING_LIST, "entity",
|
||||||
this.highlightedEntity);
|
this.highlightedEntity);
|
||||||
this.highlightedEntity = null;
|
this.highlightedEntity = null;
|
||||||
|
this.restoreIgnoredEntities();
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -475,7 +475,7 @@
|
||||||
if (textureMemSizeStabilityCount >= 15) {
|
if (textureMemSizeStabilityCount >= 15) {
|
||||||
|
|
||||||
if (textureResourceGPUMemSize > 0) {
|
if (textureResourceGPUMemSize > 0) {
|
||||||
print((texturePopulatedGPUMemSize / textureResourceGPUMemSize));
|
// print((texturePopulatedGPUMemSize / textureResourceGPUMemSize));
|
||||||
var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize);
|
var gpuPercantage = (TOTAL_LOADING_PROGRESS * 0.6) * (texturePopulatedGPUMemSize / textureResourceGPUMemSize);
|
||||||
var totalProgress = progress + gpuPercantage;
|
var totalProgress = progress + gpuPercantage;
|
||||||
if (totalProgress >= target) {
|
if (totalProgress >= target) {
|
||||||
|
|
|
@ -195,7 +195,7 @@
|
||||||
}
|
}
|
||||||
if (tryAgainImageHover === overlayID) {
|
if (tryAgainImageHover === overlayID) {
|
||||||
location.goToLastAddress();
|
location.goToLastAddress();
|
||||||
} else if (backImageHover === overlayID) {
|
} else if (backImageHover === overlayID && location.canGoBack()) {
|
||||||
location.goBack();
|
location.goBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -216,7 +216,7 @@
|
||||||
|
|
||||||
Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay);
|
Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay);
|
||||||
Overlays.hoverEnterOverlay.connect(function(overlayID, event) {
|
Overlays.hoverEnterOverlay.connect(function(overlayID, event) {
|
||||||
if (overlayID === backImageNeutral) {
|
if (overlayID === backImageNeutral && location.canGoBack()) {
|
||||||
Overlays.editOverlay(backImageNeutral, {visible: false});
|
Overlays.editOverlay(backImageNeutral, {visible: false});
|
||||||
Overlays.editOverlay(backImageHover, {visible: true});
|
Overlays.editOverlay(backImageHover, {visible: true});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue