mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 11:41:17 +02:00
checkboxes working
This commit is contained in:
parent
94fdf6b091
commit
19cd3ec152
3 changed files with 62 additions and 61 deletions
|
@ -1542,7 +1542,6 @@ PropertiesTool = function(opts) {
|
||||||
print(data.message);
|
print(data.message);
|
||||||
}
|
}
|
||||||
} else if (data.type == "update") {
|
} else if (data.type == "update") {
|
||||||
print("EBL WE GOT AN UPDATE! " + JSON.stringify(data))
|
|
||||||
selectionManager.saveProperties();
|
selectionManager.saveProperties();
|
||||||
if (selectionManager.selections.length > 1) {
|
if (selectionManager.selections.length > 1) {
|
||||||
properties = {
|
properties = {
|
||||||
|
|
|
@ -218,6 +218,28 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function updateCheckedSubProperty(propertyName, propertyValue, subPropertyElement, subPropertyString) {
|
||||||
|
if (subPropertyElement.checked) {
|
||||||
|
if (propertyValue.indexOf(subPropertyString)) {
|
||||||
|
propertyValue += subPropertyString + ',';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// We've unchecked, so remove
|
||||||
|
propertyValue = propertyValue.replace(subPropertyString + ",", "");
|
||||||
|
}
|
||||||
|
|
||||||
|
var _properties ={}
|
||||||
|
_properties[propertyName] = propertyValue;
|
||||||
|
|
||||||
|
EventBridge.emitWebEvent(
|
||||||
|
JSON.stringify({
|
||||||
|
type: "update",
|
||||||
|
properties: _properties
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
function loaded() {
|
function loaded() {
|
||||||
openEventBridge(function() {
|
openEventBridge(function() {
|
||||||
var allSections = [];
|
var allSections = [];
|
||||||
|
@ -501,7 +523,6 @@
|
||||||
elDynamic.checked = properties.dynamic;
|
elDynamic.checked = properties.dynamic;
|
||||||
|
|
||||||
|
|
||||||
console.log('STARTCHECK', properties.collidesWith)
|
|
||||||
elCollideStatic.checked = properties.collidesWith.indexOf("static") > -1;
|
elCollideStatic.checked = properties.collidesWith.indexOf("static") > -1;
|
||||||
elCollideKinematic.checked = properties.collidesWith.indexOf("kinematic") > -1;
|
elCollideKinematic.checked = properties.collidesWith.indexOf("kinematic") > -1;
|
||||||
elCollideDynamic.checked = properties.collidesWith.indexOf("dynamic") > -1;
|
elCollideDynamic.checked = properties.collidesWith.indexOf("dynamic") > -1;
|
||||||
|
@ -732,31 +753,9 @@
|
||||||
elDynamic.addEventListener('change', createEmitCheckedPropertyUpdateFunction('dynamic'));
|
elDynamic.addEventListener('change', createEmitCheckedPropertyUpdateFunction('dynamic'));
|
||||||
|
|
||||||
|
|
||||||
function updateCheckedSubProperty(propertyName, propertyValue, subPropertyElement, subPropertyString) {
|
|
||||||
console.log("UPDATE CHECKED PROP")
|
|
||||||
if (subPropertyElement.checked) {
|
|
||||||
if (propertyValue.indexOf(subPropertyString)) {
|
|
||||||
propertyValue += subPropertyString + ',';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// We've unchecked, so remove
|
|
||||||
propertyValue = propertyValue.replace(subPropertyString + ",", "");
|
|
||||||
}
|
|
||||||
|
|
||||||
var _properties ={}
|
|
||||||
_properties[propertyName] = propertyValue;
|
|
||||||
|
|
||||||
EventBridge.emitWebEvent(
|
|
||||||
JSON.stringify({
|
|
||||||
type: "update",
|
|
||||||
properties: _properties
|
|
||||||
})
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
elCollideDynamic.addEventListener('change', function() {
|
elCollideDynamic.addEventListener('change', function() {
|
||||||
console.log("CHANGE!")
|
|
||||||
updateCheckedSubProperty("collidesWith", properties.collidesWith, elCollideDynamic, 'dynamic');
|
updateCheckedSubProperty("collidesWith", properties.collidesWith, elCollideDynamic, 'dynamic');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -1459,46 +1458,45 @@
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
|
||||||
<div> collidesWith </div>
|
<div class = "sub-section-header"> Collides With: </div>
|
||||||
|
<div class = "sub-props-checkbox-group">
|
||||||
|
<div class="property">
|
||||||
|
<span class="label"> Static</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type='checkbox' id="property-collide-static">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div class="property">
|
<div class="property">
|
||||||
<span class="label">Static</span>
|
<span class="label"> dynamic</span>
|
||||||
<span class="value">
|
<span class="value">
|
||||||
<input type='checkbox' id="property-collide-static">
|
<input type='checkbox' id="property-collide-dynamic">
|
||||||
</span>
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="property">
|
||||||
|
<span class="label"> kinematic</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type='checkbox' id="property-collide-kinematic">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="property">
|
||||||
|
<span class="label"> myAvatar</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type='checkbox' id="property-collide-myAvatar">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="property">
|
||||||
|
<span class="label"> otherAvatar</span>
|
||||||
|
<span class="value">
|
||||||
|
<input type='checkbox' id="property-collide-otherAvatar">
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="property">
|
|
||||||
<span class="label">dynamic</span>
|
|
||||||
<span class="value">
|
|
||||||
<input type='checkbox' id="property-collide-dynamic">
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="property">
|
|
||||||
<span class="label">kinematic</span>
|
|
||||||
<span class="value">
|
|
||||||
<input type='checkbox' id="property-collide-kinematic">
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="property">
|
|
||||||
<span class="label">myAvatar</span>
|
|
||||||
<span class="value">
|
|
||||||
<input type='checkbox' id="property-collide-myAvatar">
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="property">
|
|
||||||
<span class="label">otherAvatar</span>
|
|
||||||
<span class="value">
|
|
||||||
<input type='checkbox' id="property-collide-otherAvatar">
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -263,6 +263,10 @@ table#properties-list {
|
||||||
border-bottom: 0.75pt solid #e5e5e5;
|
border-bottom: 0.75pt solid #e5e5e5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.sub-props-checkbox-group {
|
||||||
|
margin-left: 20px;
|
||||||
|
}
|
||||||
|
|
||||||
#properties-list .label {
|
#properties-list .label {
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|
Loading…
Reference in a new issue