WIP - copy skylight URL to ambient URL.

This commit is contained in:
Nissim Hadar 2017-12-28 09:35:40 -08:00
parent 03cf7710d0
commit 8bb4d1431c
3 changed files with 53 additions and 34 deletions

View file

@ -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);

View file

@ -536,6 +536,46 @@
<div></div>
</div>
</div>
<fieldset class="minor">
<legend class="sub-section-header zone-group zone-section background-section">
Background
</legend>
<div class="zone-group zone-section background-section property dropdown">
<label>Background mode</label>
<select name="SelectBackgroundMode" id="property-zone-background-mode">
<option value="inherit">Nothing</option>
<option value="skybox">Skybox</option>
</select>
</div>
</fieldset>
<fieldset class="minor skybox-section">
<legend class="sub-section-header zone-group zone-section skybox-section">
Skybox
</legend>
<fieldset class="zone-group zone-section skybox-section property rgb fstuple">
<div class="color-picker" id="property-zone-skybox-color"></div>
<legend>Skybox color</legend>
<div class="tuple">
<div>
<input type="number" class="red" id="property-zone-skybox-color-red">
<label for="property-zone-skybox-color-red">Red:</label>
</div>
<div>
<input type="number" class="green" id="property-zone-skybox-color-green">
<label for="property-zone-skybox-color-green">Green:</label>
</div>
<div>
<input type="number" class="blue" id="property-zone-skybox-color-blue">
<label for="property-zone-skybox-color-blue">Blue:</label>
</div>
</div>
</fieldset>
<div class="zone-group zone-section skybox-section property url ">
<label for="property-zone-skybox-url" width="80">Skybox URL</label>
<input type="text" id="property-zone-skybox-url">
<input type="button" id="copy-skybox-url-to-ambient-url" value="Copy URL to Ambient">
</div>
</fieldset>
<div class="sub-section-header zone-group zone-section ambient-section">
<label>Ambient Light</label>
</div>
@ -668,39 +708,7 @@
</div>
</fieldset>
</fieldset>
<fieldset class="minor">
<legend class="sub-section-header zone-group zone-section background-section">
Background
</legend>
<div class="zone-group zone-section background-section property dropdown">
<label>Background mode</label>
<select name="SelectBackgroundMode" id="property-zone-background-mode">
<option value="inherit">Nothing</option>
<option value="skybox">Skybox</option>
</select>
</div>
</fieldset>
<fieldset class="minor skybox-section">
<legend class="sub-section-header zone-group zone-section skybox-section">
Skybox
</legend>
<fieldset class="zone-group zone-section skybox-section property rgb fstuple">
<div class="color-picker" id="property-zone-skybox-color"></div>
<legend>Skybox color</legend>
<div class="tuple">
<div><input type="number" class="red" id="property-zone-skybox-color-red"><label for="property-zone-skybox-color-red">Red:</label></div>
<div><input type="number" class="green" id="property-zone-skybox-color-green"><label for="property-zone-skybox-color-green">Green:</label></div>
<div><input type="number" class="blue" id="property-zone-skybox-color-blue"><label for="property-zone-skybox-color-blue">Blue:</label></div>
</div>
</fieldset>
<div class="zone-group zone-section skybox-section property url ">
<label for="property-zone-skybox-url">Skybox URL</label>
<input type="text" id="property-zone-skybox-url">
</div>
</fieldset>
</fieldset>
<fieldset id="text" class="major">
<legend class="section-header text-group text-section">
Text<span>M</span>

View file

@ -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);