new location drop - unparent overlays

This commit is contained in:
Wayne Chen 2018-09-26 15:12:48 -07:00
parent db41a1c16b
commit db77cbcbc1
3 changed files with 25 additions and 25 deletions

View file

@ -2,7 +2,7 @@
"DataVersion": 0, "DataVersion": 0,
"Paths": "Paths":
{ {
"/": "/5.77,1.4,4.96/0,0.49544,0,0.868645" "/": "/2.3,0.4,2.89/0,0.49544,0,0.868645"
}, },
"Entities": [ "Entities": [
{ {

View file

@ -38,6 +38,7 @@
var button = null; var button = null;
var errorConnectingToDomain = false; var errorConnectingToDomain = false;
var resettingError = false;
// Tips have a character limit of 69 // Tips have a character limit of 69
var userTips = [ var userTips = [
@ -190,17 +191,6 @@
var connectionToDomainFailed = false; var connectionToDomainFailed = false;
function getOopsText() {
var error = Window.getLastDomainConnectionError();
var errorMessageMapIndex = hardRefusalErrors.indexOf(error);
if (errorMessageMapIndex >= 0) {
return ERROR_MESSAGE_MAP[errorMessageMapIndex];
} else {
// some other text.
return ERROR_MESSAGE_MAP[4];
}
}
function getAnchorLocalYOffset() { function getAnchorLocalYOffset() {
var loadingSpherePosition = Overlays.getProperty(loadingSphereID, "position"); var loadingSpherePosition = Overlays.getProperty(loadingSphereID, "position");
var loadingSphereOrientation = Overlays.getProperty(loadingSphereID, "rotation"); var loadingSphereOrientation = Overlays.getProperty(loadingSphereID, "rotation");
@ -366,11 +356,10 @@
Overlays.editOverlay(loadingBarPlacard, properties); Overlays.editOverlay(loadingBarPlacard, properties);
Overlays.editOverlay(loadingBarProgress, loadingBarProperties); Overlays.editOverlay(loadingBarProgress, loadingBarProperties);
if (errorConnectingToDomain) { Menu.setIsOptionChecked("Show Overlays", physicsEnabled);
Menu.setIsOptionChecked("Show Overlays", physicsEnabled); if (!HMD.active) {
if (!HMD.active) { print("Show toolbar: " + physicsEnabled);
toolbar.writeProperty("visible", physicsEnabled); toolbar.writeProperty("visible", physicsEnabled);
}
} }
resetValues(); resetValues();
@ -391,6 +380,15 @@
Overlays.editOverlay(anchorOverlay, { localPosition: localPosition }); Overlays.editOverlay(anchorOverlay, { localPosition: localPosition });
} }
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
break;
}
}
}
function update() { function update() {
var physicsEnabled = Window.isPhysicsEnabled(); var physicsEnabled = Window.isPhysicsEnabled();
var thisInterval = Date.now(); var thisInterval = Date.now();
@ -424,6 +422,8 @@
endAudio(); endAudio();
currentDomain = "no domain"; currentDomain = "no domain";
timer = null; timer = null;
sleep(300);
toolbar.writeProperty("visible", true);
return; return;
} else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) { } else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) {
updateOverlays((physicsEnabled || connectionToDomainFailed)); updateOverlays((physicsEnabled || connectionToDomainFailed));

View file

@ -26,10 +26,12 @@
} }
}; };
var oopsDimensions = {x: 4.2, y: 1};
var redirectOopsText = Overlays.addOverlay("text3d", { var redirectOopsText = Overlays.addOverlay("text3d", {
name: "oopsText", name: "oopsText",
localPosition: {x: 0.2691902160644531, y: 0.6403706073760986, z: 3.18358039855957}, position: {x: 0, y: 1.6763916015625, z: 1.45927095413208},
localRotation: Quat.fromPitchYawRollDegrees(0.0, 180.0, 0.0), rotation: {x: -4.57763671875e-05, y: 0.4957197904586792, z: -7.62939453125e-05, w: 0.8684672117233276},
text: getOopsText(), text: getOopsText(),
textAlpha: 1, textAlpha: 1,
backgroundAlpha: 0, backgroundAlpha: 0,
@ -39,15 +41,13 @@
visible: false, visible: false,
emissive: true, emissive: true,
ignoreRayIntersection: false, ignoreRayIntersection: false,
dimensions: {x: 4.2, y: 1}, dimensions: oopsDimensions,
grabbable: false, grabbable: false,
parentID: MyAvatar.SELF_ID,
parentJointIndex: MyAvatar.getJointIndex("Head")
}); });
var tryAgainImage = Overlays.addOverlay("image3d", { var tryAgainImage = Overlays.addOverlay("image3d", {
name: "tryAgainImage", name: "tryAgainImage",
localPosition: {x: -0.6, y: -0.4, z: 0.0}, localPosition: {x: -0.6, y: -0.6, z: 0.0},
url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png", url: Script.resourcesPath() + "images/interstitialPage/button_tryAgain.png",
alpha: 1, alpha: 1,
visible: false, visible: false,
@ -60,7 +60,7 @@
var backImage = Overlays.addOverlay("image3d", { var backImage = Overlays.addOverlay("image3d", {
name: "backImage", name: "backImage",
localPosition: {x: 0.6, y: -0.4, z: 0.0}, localPosition: {x: 0.6, y: -0.6, z: 0.0},
url: Script.resourcesPath() + "images/interstitialPage/button_back.png", url: Script.resourcesPath() + "images/interstitialPage/button_back.png",
alpha: 1, alpha: 1,
visible: false, visible: false,
@ -103,7 +103,7 @@
}; };
var textWidth = Overlays.textSize(redirectOopsText, oopsText).width; var textWidth = Overlays.textSize(redirectOopsText, oopsText).width;
var textOverlayWidth = Overlays.getProperty(redirectOopsText, "dimensions").x; var textOverlayWidth = oopsDimensions.x;
var oopsTextProperties = { var oopsTextProperties = {
visible: overlaysVisible, visible: overlaysVisible,