overte/interface/resources/serverless/Scripts/portal.js
SilverfishVR 005dac9cd6 Load serverless tutorial from local disk
fixes https://github.com/vircadia/vircadia/issues/1015

also:
* new mirror and controls poster model.
* moved controls poster so it would not be obscured by the wizzard.
* updated landing point.
* ambient music volume raised a bit, we may want to have a in-worrld toggle for this later https://github.com/vircadia/vircadia/issues/1016.
* turned the zone light up a bit so it is not so dark when on low graphic settings.
2021-04-01 03:04:02 +02:00

47 lines
1.5 KiB
JavaScript

//
// portal.js
// Created by Zach Fox on 2019-05-23
// Copyright 2019 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
(function () {
var Portal = function() {};
Portal.prototype = {
enterEntity: function (id) {
var properties = Entities.getEntityProperties(id, ["userData"]);
var userData;
try {
userData = JSON.parse(properties.userData);
} catch (e) {
console.error("Error parsing userData: ", e);
}
if (userData) {
if (userData.destination) {
var destination = userData.destination;
if (userData.destination.indexOf("bookmark:") > -1) {
var bookmarkName = userData.destination.replace("bookmark:", "");
destination = LocationBookmarks.getAddress(bookmarkName);
}
Window.location = destination;
} else {
console.log("Please specify `destination` inside this entity's `userData`!");
return;
}
} else {
console.log("Please specify this entity's `userData`! See README.md for instructions.");
return;
}
}
};
return new Portal();
});