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

View file

@ -2089,8 +2089,6 @@ var PropertiesTool = function (opts) {
Entities.reloadServerScripts(selectionManager.selections[i]); Entities.reloadServerScripts(selectionManager.selections[i]);
} }
} }
} else if (data.action === "copySkyboxURLToAmbientURL") {
Window.notifyEditError("I DON'T KNOW HOW :(");
} }
} else if (data.type === "propertiesPageReady") { } else if (data.type === "propertiesPageReady") {
updateSelections(true); updateSelections(true);

View file

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

View file

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