editing the interstitial page

This commit is contained in:
Dante Ruiz 2018-09-06 17:06:17 -07:00
parent 98dafa3b67
commit 2f9119529a
4 changed files with 20 additions and 21 deletions

View file

@ -3488,14 +3488,11 @@ bool Application::isServerlessMode() const {
} }
bool Application::isInterstitialMode() const { bool Application::isInterstitialMode() const {
bool interstitialModeEnabled = Menu::getInstance()->isOptionChecked("Enable Interstitial"); return _interstitialMode;
return interstitialModeEnabled ? _interstitialMode : false;
} }
void Application::setIsInterstitialMode(bool interstitialMode) { void Application::setIsInterstitialMode(bool interstitialMode) {
auto menu = Menu::getInstance(); if (_interstitialMode != interstitialMode) {
bool interstitialModeEnabled = menu->isOptionChecked("Enable Interstitial");
if (_interstitialMode != interstitialMode && interstitialModeEnabled) {
_interstitialMode = interstitialMode; _interstitialMode = interstitialMode;
emit interstitialModeChanged(_interstitialMode); emit interstitialModeChanged(_interstitialMode);
} }

View file

@ -787,7 +787,6 @@ Menu::Menu() {
// Developer > Show Overlays // Developer > Show Overlays
addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Overlays, 0, true); addCheckableActionToQMenuAndActionHash(developerMenu, MenuOption::Overlays, 0, true);
addCheckableActionToQMenuAndActionHash(developerMenu, "Enable Interstitial", 0, false);
#if 0 /// -------------- REMOVED FOR NOW -------------- #if 0 /// -------------- REMOVED FOR NOW --------------
addDisabledActionAndSeparator(navigateMenu, "History"); addDisabledActionAndSeparator(navigateMenu, "History");

View file

@ -34,7 +34,8 @@ var DEFAULT_SCRIPTS_COMBINED = [
"system/emote.js" "system/emote.js"
]; ];
var DEFAULT_SCRIPTS_SEPARATE = [ var DEFAULT_SCRIPTS_SEPARATE = [
"system/controllers/controllerScripts.js" "system/controllers/controllerScripts.js",
"system/interstitialPage.js"
//"system/chat.js" //"system/chat.js"
]; ];

View file

@ -14,8 +14,9 @@
(function() { (function() {
Script.include("/~/system/libraries/Xform.js"); Script.include("/~/system/libraries/Xform.js");
var DEBUG = false; var DEBUG = true;
var MAX_X_SIZE = 3.8; var MIN_LOADING_PROGRESS = 3.6;
var TOTAL_LOADING_PROGRESS = 3.8;
var EPSILON = 0.01; var EPSILON = 0.01;
var isVisible = false; var isVisible = false;
var VOLUME = 0.4; var VOLUME = 0.4;
@ -55,7 +56,7 @@
"Tip: Log in to make friends, visit new domains, and save avatars!" "Tip: Log in to make friends, visit new domains, and save avatars!"
]; ];
var DEFAULT_DIMENSIONS = { x: 20, y: 20, z: 20 }; var DEFAULT_DIMENSIONS = { x: 24, y: 24, z: 24 };
var loadingSphereID = Overlays.addOverlay("model", { var loadingSphereID = Overlays.addOverlay("model", {
name: "Loading-Sphere", name: "Loading-Sphere",
@ -87,10 +88,10 @@
var domainName = ""; var domainName = "";
var domainNameTextID = Overlays.addOverlay("text3d", { var domainNameTextID = Overlays.addOverlay("text3d", {
name: "Loading-Destination-Card-Text", name: "Loading-Destination-Card-Text",
localPosition: { x: 0.0, y: 0.8, z: 0.0 }, localPosition: { x: 0.0, y: 0.8, z: -0.001 },
text: domainName, text: domainName,
textAlpha: 1, textAlpha: 1,
backgroundAlpha: 0, backgroundAlpha: 1,
lineHeight: 0.42, lineHeight: 0.42,
visible: isVisible, visible: isVisible,
ignoreRayIntersection: true, ignoreRayIntersection: true,
@ -106,9 +107,10 @@
localPosition: { x: 0.0, y: 0.32, z: 0.0 }, localPosition: { x: 0.0, y: 0.32, z: 0.0 },
text: domainText, text: domainText,
textAlpha: 1, textAlpha: 1,
backgroundAlpha: 0, backgroundAlpha: 1,
lineHeight: 0.13, lineHeight: 0.13,
visible: isVisible, visible: isVisible,
backgroundAlpha: 0,
ignoreRayIntersection: true, ignoreRayIntersection: true,
drawInFront: true, drawInFront: true,
grabbable: false, grabbable: false,
@ -123,7 +125,7 @@
localPosition: { x: 0.0 , y: -1.6, z: 0.0 }, localPosition: { x: 0.0 , y: -1.6, z: 0.0 },
text: toolTip, text: toolTip,
textAlpha: 1, textAlpha: 1,
backgroundAlpha: 0, backgroundAlpha: 1,
lineHeight: 0.13, lineHeight: 0.13,
visible: isVisible, visible: isVisible,
ignoreRayIntersection: true, ignoreRayIntersection: true,
@ -248,7 +250,6 @@
} }
function domainChanged(domain) { function domainChanged(domain) {
print("domain changed: " + domain);
if (domain !== currentDomain) { if (domain !== currentDomain) {
MyAvatar.restoreAnimation(); MyAvatar.restoreAnimation();
var name = location.placename; var name = location.placename;
@ -272,7 +273,6 @@
if (data.status === "success") { if (data.status === "success") {
var domainInfo = data.data; var domainInfo = data.data;
var domainDescriptionText = domainInfo.place.description; var domainDescriptionText = domainInfo.place.description;
print("domainText: " + domainDescriptionText);
var leftMargin = getLeftMargin(domainDescription, domainDescriptionText); var leftMargin = getLeftMargin(domainDescription, domainDescriptionText);
var domainDescriptionProperties = { var domainDescriptionProperties = {
text: domainDescriptionText, text: domainDescriptionText,
@ -381,18 +381,18 @@
var domainLoadingProgressPercentage = Window.domainLoadingProgress(); var domainLoadingProgressPercentage = Window.domainLoadingProgress();
var progress = MAX_X_SIZE * domainLoadingProgressPercentage; var progress = MIN_LOADING_PROGRESS * domainLoadingProgressPercentage;
if (progress >= target) { if (progress >= target) {
target = progress; target = progress;
} }
if ((physicsEnabled && (currentProgress < MAX_X_SIZE))) { if ((physicsEnabled && (currentProgress < TOTAL_LOADING_PROGRESS))) {
target = MAX_X_SIZE; target = TOTAL_LOADING_PROGRESS;
} }
currentProgress = lerp(currentProgress, target, 0.2); currentProgress = lerp(currentProgress, target, 0.2);
var properties = { var properties = {
localPosition: { x: (1.85 - (currentProgress / 2) - (-0.029 * (currentProgress / MAX_X_SIZE))), y: -0.935, z: 0.0 }, localPosition: { x: (1.85 - (currentProgress / 2) - (-0.029 * (currentProgress / TOTAL_LOADING_PROGRESS))), y: -0.935, z: 0.0 },
dimensions: { dimensions: {
x: currentProgress, x: currentProgress,
y: 2.8 y: 2.8
@ -400,9 +400,10 @@
}; };
Overlays.editOverlay(loadingBarProgress, properties); Overlays.editOverlay(loadingBarProgress, properties);
if ((physicsEnabled && (currentProgress >= (MAX_X_SIZE - EPSILON)))) { if ((physicsEnabled && (currentProgress >= (TOTAL_LOADING_PROGRESS - EPSILON)))) {
updateOverlays((physicsEnabled || connectionToDomainFailed)); updateOverlays((physicsEnabled || connectionToDomainFailed));
endAudio(); endAudio();
currentDomain = "no domain";
timer = null; timer = null;
return; return;
} }
@ -452,6 +453,7 @@
renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = true; renderViewTask.getConfig("LightingModel")["enableAmbientLight"] = true;
renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = true; renderViewTask.getConfig("LightingModel")["enableDirectionalLight"] = true;
renderViewTask.getConfig("LightingModel")["enablePointLight"] = true; renderViewTask.getConfig("LightingModel")["enablePointLight"] = true;
Menu.setIsOptionChecked("Show Overlays", physicsEnabled);
if (!HMD.active) { if (!HMD.active) {
toolbar.writeProperty("visible", true); toolbar.writeProperty("visible", true);
} }