Zone inheritance ready for testing.

This commit is contained in:
Nissim Hadar 2017-12-29 15:13:46 -08:00
parent 0e76d481a1
commit 87e896ab20
4 changed files with 9 additions and 11 deletions

View file

@ -184,8 +184,7 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) {
// Just turned off, store previous value before changing
_skyboxOnIndex = _backgroundIndex;
_backgroundIndex = _stage->getSunOffLight();
}
else if (_skyboxMode == COMPONENT_MODE_ENABLED && _skyboxOnIndex != NO_STORED_VALUE) {
} else if (_skyboxMode == COMPONENT_MODE_ENABLED && _skyboxOnIndex != NO_STORED_VALUE) {
// Just turned on, restore previous value before clearing stored value
_backgroundIndex = _skyboxOnIndex;
_skyboxOnIndex = NO_STORED_VALUE;
@ -200,14 +199,13 @@ void ZoneEntityRenderer::doRender(RenderArgs* args) {
// Just turned off, store previous value before changing
_ambientOnIndex = _ambientIndex;
_ambientIndex = _stage->getAmbientOffLight();
}
else if (_ambientLightMode == COMPONENT_MODE_ENABLED && _ambientOnIndex != NO_STORED_VALUE) {
} else if (_ambientLightMode == COMPONENT_MODE_ENABLED && _ambientOnIndex != NO_STORED_VALUE) {
// Just turned on, restore previous value before clearing stored value
_ambientIndex = _ambientOnIndex;
_ambientOnIndex = NO_STORED_VALUE;
}
if (_ambientLightMode != COMPONENT_MODE_INHERIT && (_validAmbientTexture || _validSkyboxTexture)) {
if (_ambientLightMode != COMPONENT_MODE_INHERIT && (_validAmbientTexture)) {
_stage->_currentFrame.pushAmbientLight(_ambientIndex);
}

View file

@ -2089,8 +2089,6 @@ 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

@ -564,8 +564,11 @@
</div>
</fieldset>
<div class="zone-group zone-section skybox-section property url ">
<br>
<label for="property-zone-skybox-url" width="80">Skybox URL</label>
<input type="text" id="property-zone-skybox-url">
<br>
<br>
<input type="button" id="copy-skybox-url-to-ambient-url" value="Copy URL to Ambient">
</div>
</fieldset>

View file

@ -1492,10 +1492,9 @@ function loaded() {
// Ambient light
elCopySkyboxURLToAmbientURL.addEventListener("click", function () {
EventBridge.emitWebEvent(JSON.stringify({
type: "action",
action: "copySkyboxURLToAmbientURL"
}));
document.getElementById("property-zone-key-ambient-url").value = properties.skybox.url;
properties.ambientLight.ambientURL = properties.skybox.url;
updateProperties(properties);
});
var ambientLightModeChanged = createZoneComponentModeChangedFunction('ambientLightMode',