Made MP3 constistant 128kbps and fixed path resolving

This commit is contained in:
Flame Soulis 2018-10-19 08:16:14 -04:00
parent e499309c8e
commit 014c1590dd
2 changed files with 32 additions and 32 deletions

View file

@ -12,7 +12,7 @@
/* global Script, Controller, Overlays, Quat, MyAvatar, Entities, print, Vec3, AddressManager, Render, Window, Toolbars,
Camera, HMD, location, Account, Xform*/
(function() {
(function () {
Script.include("/~/system/libraries/Xform.js");
var DEBUG = false;
var MIN_LOADING_PROGRESS = 3.6;
@ -20,7 +20,7 @@
var EPSILON = 0.01;
var isVisible = false;
var VOLUME = 0.4;
var tune = SoundCache.getSound("/~/system/assets/sounds/crystals_and_voices.mp3");
var tune = SoundCache.getSound(Script.resolvePath("/~/system/assets/sounds/crystals_and_voices.mp3"));
var sample = null;
var MAX_LEFT_MARGIN = 1.9;
var INNER_CIRCLE_WIDTH = 4.7;
@ -62,8 +62,8 @@
var loadingSphereID = Overlays.addOverlay("model", {
name: "Loading-Sphere",
position: Vec3.sum(Vec3.sum(MyAvatar.position, {x: 0.0, y: -1.0, z: 0.0}), Vec3.multiplyQbyV(MyAvatar.orientation, {x: 0, y: 0.95, z: 0})),
orientation: Quat.multiply(Quat.fromVec3Degrees({x: 0, y: 180, z: 0}), MyAvatar.orientation),
position: Vec3.sum(Vec3.sum(MyAvatar.position, { x: 0.0, y: -1.0, z: 0.0 }), Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0.95, z: 0 })),
orientation: Quat.multiply(Quat.fromVec3Degrees({ x: 0, y: 180, z: 0 }), MyAvatar.orientation),
url: "http://hifi-content.s3.amazonaws.com/alexia/LoadingScreens/black-sphere.fbx",
dimensions: DEFAULT_DIMENSIONS,
alpha: 1,
@ -75,12 +75,12 @@
});
var anchorOverlay = Overlays.addOverlay("cube", {
dimensions: {x: 0.2, y: 0.2, z: 0.2},
dimensions: { x: 0.2, y: 0.2, z: 0.2 },
visible: false,
grabbable: false,
ignoreRayIntersection: true,
localPosition: {x: 0.0, y: getAnchorLocalYOffset(), z: DEFAULT_Z_OFFSET },
orientation: Quat.multiply(Quat.fromVec3Degrees({x: 0, y: 180, z: 0}), MyAvatar.orientation),
localPosition: { x: 0.0, y: getAnchorLocalYOffset(), z: DEFAULT_Z_OFFSET },
orientation: Quat.multiply(Quat.fromVec3Degrees({ x: 0, y: 180, z: 0 }), MyAvatar.orientation),
solid: true,
drawInFront: true,
parentID: loadingSphereID
@ -124,7 +124,7 @@
var domainToolTip = Overlays.addOverlay("text3d", {
name: "Loading-Tooltip",
localPosition: { x: 0.0 , y: -1.6, z: 0.0 },
localPosition: { x: 0.0, y: -1.6, z: 0.0 },
text: toolTip,
textAlpha: 1,
backgroundAlpha: 0.00393,
@ -139,14 +139,14 @@
var loadingToTheSpotText = Overlays.addOverlay("text3d", {
name: "Loading-Destination-Card-Text",
localPosition: { x: 0.0 , y: -1.687, z: -0.3 },
localPosition: { x: 0.0, y: -1.687, z: -0.3 },
text: "Go To TheSpot",
textAlpha: 1,
backgroundAlpha: 0.00393,
lineHeight: 0.10,
visible: isVisible,
ignoreRayIntersection: true,
dimensions: {x: 1, y: 0.17},
dimensions: { x: 1, y: 0.17 },
drawInFront: true,
grabbable: false,
localOrientation: Quat.fromVec3Degrees({ x: 0, y: 180, z: 0 }),
@ -155,7 +155,7 @@
var loadingToTheSpotID = Overlays.addOverlay("image3d", {
name: "Loading-Destination-Card-GoTo-Image",
localPosition: { x: 0.0 , y: -1.75, z: -0.3 },
localPosition: { x: 0.0, y: -1.75, z: -0.3 },
url: Script.resourcesPath() + "images/interstitialPage/button.png",
alpha: 1,
visible: isVisible,
@ -169,7 +169,7 @@
var loadingToTheSpotHoverID = Overlays.addOverlay("image3d", {
name: "Loading-Destination-Card-GoTo-Image-Hover",
localPosition: { x: 0.0 , y: -1.75, z: -0.3 },
localPosition: { x: 0.0, y: -1.75, z: -0.3 },
url: Script.resourcesPath() + "images/interstitialPage/button_hover.png",
alpha: 1,
visible: false,
@ -186,7 +186,7 @@
localPosition: { x: 0.0, y: -0.99, z: 0.3 },
url: Script.resourcesPath() + "images/loadingBar_placard.png",
alpha: 1,
dimensions: { x: 4, y: 2.8},
dimensions: { x: 4, y: 2.8 },
visible: isVisible,
emissive: true,
ignoreRayIntersection: false,
@ -201,7 +201,7 @@
localPosition: { x: 0.0, y: -0.90, z: 0.0 },
url: Script.resourcesPath() + "images/loadingBar_progress.png",
alpha: 1,
dimensions: {x: 3.8, y: 2.8},
dimensions: { x: 3.8, y: 2.8 },
visible: isVisible,
emissive: true,
ignoreRayIntersection: false,
@ -244,7 +244,7 @@
}
function resetValues() {
var properties = {
var properties = {
localPosition: { x: 1.85, y: -0.935, z: 0.0 },
dimensions: {
x: 0.1,
@ -311,7 +311,7 @@
var url = Account.metaverseServerURL + '/api/v1/places/' + domain;
request({
uri: url
}, function(error, data) {
}, function (error, data) {
if (data.status === "success") {
var domainInfo = data.data;
var domainDescriptionText = domainInfo.place.description;
@ -347,12 +347,12 @@
}
}
var THE_PLACE = (HifiAbout.buildVersion === "dev") ? "hifi://TheSpot-dev": "hifi://TheSpot";
var THE_PLACE = (HifiAbout.buildVersion === "dev") ? "hifi://TheSpot-dev" : "hifi://TheSpot";
function clickedOnOverlay(overlayID, event) {
if (loadingToTheSpotHoverID === overlayID) {
location.handleLookupString(THE_PLACE);
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
Overlays.editOverlay(loadingToTheSpotID, {visible: true});
Overlays.editOverlay(loadingToTheSpotHoverID, { visible: false });
Overlays.editOverlay(loadingToTheSpotID, { visible: true });
}
}
@ -361,8 +361,8 @@
return;
}
if (overlayID === loadingToTheSpotID) {
Overlays.editOverlay(loadingToTheSpotID, {visible: false});
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: true});
Overlays.editOverlay(loadingToTheSpotID, { visible: false });
Overlays.editOverlay(loadingToTheSpotHoverID, { visible: true });
}
}
@ -371,8 +371,8 @@
return;
}
if (overlayID === loadingToTheSpotHoverID) {
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
Overlays.editOverlay(loadingToTheSpotID, {visible: true});
Overlays.editOverlay(loadingToTheSpotHoverID, { visible: false });
Overlays.editOverlay(loadingToTheSpotID, { visible: true });
}
}
@ -441,7 +441,7 @@
function sleep(milliseconds) {
var start = new Date().getTime();
for (var i = 0; i < 1e7; i++) {
if ((new Date().getTime() - start) > milliseconds){
if ((new Date().getTime() - start) > milliseconds) {
break;
}
}
@ -503,7 +503,7 @@
if (errorConnectingToDomain) {
updateOverlays(errorConnectingToDomain);
// setting hover id to invisible
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
Overlays.editOverlay(loadingToTheSpotHoverID, { visible: false });
endAudio();
currentDomain = "no domain";
timer = null;
@ -519,7 +519,7 @@
} else if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) {
updateOverlays((physicsEnabled || connectionToDomainFailed));
// setting hover id to invisible
Overlays.editOverlay(loadingToTheSpotHoverID, {visible: false});
Overlays.editOverlay(loadingToTheSpotHoverID, { visible: false });
endAudio();
currentDomain = "no domain";
timer = null;
@ -527,23 +527,23 @@
}
timer = Script.setTimeout(update, BASIC_TIMER_INTERVAL_MS);
}
var whiteColor = {red: 255, green: 255, blue: 255};
var greyColor = {red: 125, green: 125, blue: 125};
var whiteColor = { red: 255, green: 255, blue: 255 };
var greyColor = { red: 125, green: 125, blue: 125 };
Overlays.mouseReleaseOnOverlay.connect(clickedOnOverlay);
Overlays.hoverEnterOverlay.connect(onEnterOverlay);
Overlays.hoverLeaveOverlay.connect(onLeaveOverlay);
location.hostChanged.connect(domainChanged);
location.lookupResultsFinished.connect(function() {
Script.setTimeout(function() {
location.lookupResultsFinished.connect(function () {
Script.setTimeout(function () {
connectionToDomainFailed = !location.isConnected;
}, 1200);
});
Window.redirectErrorStateChanged.connect(toggleInterstitialPage);
MyAvatar.sensorToWorldScaleChanged.connect(scaleInterstitialPage);
MyAvatar.sessionUUIDChanged.connect(function() {
MyAvatar.sessionUUIDChanged.connect(function () {
var avatarSessionUUID = MyAvatar.sessionUUID;
Overlays.editOverlay(loadingSphereID, { parentID: avatarSessionUUID });
});
@ -553,7 +553,7 @@
tablet = Tablet.getTablet("com.highfidelity.interface.tablet.system");
button = tablet.addButton(BUTTON_PROPERTIES);
button.clicked.connect(function() {
button.clicked.connect(function () {
toggle = !toggle;
updateOverlays(toggle);
});