diff --git a/examples/html/entityProperties.html b/examples/html/entityProperties.html index e525818e51..26bcc63f15 100644 --- a/examples/html/entityProperties.html +++ b/examples/html/entityProperties.html @@ -26,6 +26,20 @@ ); }; } + function createEmitGroupCheckedPropertyUpdateFunction(group, propertyName) { + return function() { + var properties = {}; + properties[group] = {}; + properties[group][propertyName] = this.checked; + EventBridge.emitWebEvent( + JSON.stringify({ + type: "update", + properties: properties + }) + ); + }; + } + function createEmitNumberPropertyUpdateFunction(propertyName) { return function() { EventBridge.emitWebEvent( @@ -286,6 +300,8 @@ var elZoneAtmosphereScatteringWavelengthsX = document.getElementById("property-zone-atmosphere-scattering-wavelengths-x"); var elZoneAtmosphereScatteringWavelengthsY = document.getElementById("property-zone-atmosphere-scattering-wavelengths-y"); var elZoneAtmosphereScatteringWavelengthsZ = document.getElementById("property-zone-atmosphere-scattering-wavelengths-z"); + var elZoneAtmosphereHasStars = document.getElementById("property-zone-atmosphere-has-stars"); + if (window.EventBridge !== undefined) { EventBridge.scriptEventReceived.connect(function(data) { @@ -486,7 +502,7 @@ elZoneAtmosphereScatteringWavelengthsX.value = properties.atmosphere.scatteringWavelengths.x; elZoneAtmosphereScatteringWavelengthsY.value = properties.atmosphere.scatteringWavelengths.y; elZoneAtmosphereScatteringWavelengthsZ.value = properties.atmosphere.scatteringWavelengths.z; - + elZoneAtmosphereHasStars.checked = properties.atmosphere.hasStars; } @@ -650,6 +666,8 @@ elZoneAtmosphereScatteringWavelengthsX.addEventListener('change', zoneAtmosphereScatterWavelengthsChangeFunction); elZoneAtmosphereScatteringWavelengthsY.addEventListener('change', zoneAtmosphereScatterWavelengthsChangeFunction); elZoneAtmosphereScatteringWavelengthsZ.addEventListener('change', zoneAtmosphereScatterWavelengthsChangeFunction); + elZoneAtmosphereHasStars.addEventListener('change', createEmitGroupCheckedPropertyUpdateFunction('atmosphere','hasStars')); + elMoveSelectionToGrid.addEventListener("click", function() { EventBridge.emitWebEvent(JSON.stringify({ @@ -1136,23 +1154,29 @@