From 8bb4d1431cd8d32cd7604fd8e07228b62b8f6360 Mon Sep 17 00:00:00 2001 From: Nissim Hadar Date: Thu, 28 Dec 2017 09:35:40 -0800 Subject: [PATCH] WIP - copy skylight URL to ambient URL. --- scripts/system/edit.js | 6 +- scripts/system/html/entityProperties.html | 72 ++++++++++++---------- scripts/system/html/js/entityProperties.js | 9 +++ 3 files changed, 53 insertions(+), 34 deletions(-) diff --git a/scripts/system/edit.js b/scripts/system/edit.js index e28f877d85..ae3f88bd4e 100644 --- a/scripts/system/edit.js +++ b/scripts/system/edit.js @@ -2044,9 +2044,9 @@ var PropertiesTool = function (opts) { // If any of the natural dimensions are not 0, resize if (properties.type === "Model" && naturalDimensions.x === 0 && naturalDimensions.y === 0 && - naturalDimensions.z === 0) { + naturalDimensions.z === 0) { Window.notifyEditError("Cannot reset entity to its natural dimensions: Model URL" + - " is invalid or the model has not yet been loaded."); + " is invalid or the model has not yet been loaded."); } else { Entities.editEntity(selectionManager.selections[i], { dimensions: properties.naturalDimensions @@ -2089,6 +2089,8 @@ var PropertiesTool = function (opts) { Entities.reloadServerScripts(selectionManager.selections[i]); } } + } else if (data.action === "copySkyboxURLToAmbientURL") { + Window.notifyEditError("I DON'T KNOW HOW :("); } } else if (data.type === "propertiesPageReady") { updateSelections(true); diff --git a/scripts/system/html/entityProperties.html b/scripts/system/html/entityProperties.html index c914ec34d4..40ed8fe18f 100644 --- a/scripts/system/html/entityProperties.html +++ b/scripts/system/html/entityProperties.html @@ -536,6 +536,46 @@
+
+ + Background + + +
+
+ + Skybox + +
+
+ Skybox color +
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + + +
+
@@ -668,39 +708,7 @@ -
- - Background - - -
-
- - Skybox - -
-
- Skybox color -
-
-
-
-
-
-
- - -
-
- -
TextM diff --git a/scripts/system/html/js/entityProperties.js b/scripts/system/html/js/entityProperties.js index 5d788726f6..390aeae96d 100644 --- a/scripts/system/html/js/entityProperties.js +++ b/scripts/system/html/js/entityProperties.js @@ -654,6 +654,8 @@ function loaded() { var elZoneKeyLightDirectionY = document.getElementById("property-zone-key-light-direction-y"); // Ambient light + var elCopySkyboxURLToAmbientURL = document.getElementById("copy-skybox-url-to-ambient-url"); + var elZoneAmbientLightModeInherit = document.getElementById("property-zone-ambient-light-mode-inherit"); var elZoneAmbientLightModeDisabled = document.getElementById("property-zone-ambient-light-mode-disabled"); var elZoneAmbientLightModeEnabled = document.getElementById("property-zone-ambient-light-mode-enabled"); @@ -1467,6 +1469,13 @@ function loaded() { elZoneKeyLightDirectionY.addEventListener('change', zoneKeyLightDirectionChangeFunction); // Ambient light + elCopySkyboxURLToAmbientURL.addEventListener("click", function () { + EventBridge.emitWebEvent(JSON.stringify({ + type: "action", + action: "copySkyboxURLToAmbientURL" + })); + }); + var ambientLightModeChanged = createZoneComponentModeChangedFunction('ambientLightMode', elZoneAmbientLightModeInherit, elZoneAmbientLightModeDisabled, elZoneAmbientLightModeEnabled);