mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 17:38:15 +02:00
removing dynamic. need to add others
This commit is contained in:
parent
168fb67d67
commit
0f8f67ef0b
1 changed files with 48 additions and 1 deletions
|
@ -47,6 +47,17 @@
|
|||
);
|
||||
};
|
||||
}
|
||||
|
||||
function createEmitCheckedToStringPropertyUpdateFunction(checkboxElement, name, propertyName) {
|
||||
var newString = "";
|
||||
if (checkboxElement.checked) {
|
||||
newString += name + "";
|
||||
} else {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function createEmitGroupCheckedPropertyUpdateFunction(group, propertyName) {
|
||||
return function () {
|
||||
var properties = {};
|
||||
|
@ -263,6 +274,11 @@
|
|||
var elDensity = document.getElementById("property-density");
|
||||
var elCollisionless = document.getElementById("property-collisionless");
|
||||
var elDynamic = document.getElementById("property-dynamic" );
|
||||
var elCollideStatic = document.getElementById("property-collide-static");
|
||||
var elCollideDynamic = document.getElementById("property-collide-dynamic");
|
||||
var elCollideKinematic = document.getElementById("property-collide-kinematic");
|
||||
var elCollideMyAvatar = document.getElementById("property-collide-myAvatar");
|
||||
var elCollideOtherAvatar = document.getElementById("property-collide-otherAvatar");
|
||||
var elCollisionSoundURL = document.getElementById("property-collision-sound-url");
|
||||
var elLifetime = document.getElementById("property-lifetime");
|
||||
var elScriptURL = document.getElementById("property-script-url");
|
||||
|
@ -378,6 +394,7 @@
|
|||
var elPreviewCameraButton = document.getElementById("preview-camera-button");
|
||||
|
||||
if (window.EventBridge !== undefined) {
|
||||
var properties;
|
||||
EventBridge.scriptEventReceived.connect(function(data) {
|
||||
data = JSON.parse(data);
|
||||
if (data.type == "update") {
|
||||
|
@ -419,7 +436,7 @@
|
|||
var selected = false;
|
||||
}
|
||||
|
||||
var properties = data.selections[0].properties;
|
||||
properties = data.selections[0].properties;
|
||||
|
||||
elID.innerHTML = properties.id;
|
||||
|
||||
|
@ -433,6 +450,7 @@
|
|||
} else {
|
||||
enableChildren(document.getElementById("properties-list"), 'input');
|
||||
}
|
||||
|
||||
|
||||
elName.value = properties.name;
|
||||
|
||||
|
@ -481,6 +499,16 @@
|
|||
elDensity.value = properties.density.toFixed(4);
|
||||
elCollisionless.checked = properties.collisionless;
|
||||
elDynamic.checked = properties.dynamic;
|
||||
|
||||
|
||||
|
||||
elCollideStatic.checked = properties.collidesWith.indexOf("static") > -1;
|
||||
elCollideKinematic.checked = properties.collidesWith.indexOf("kinematic") > -1;
|
||||
elCollideDynamic.checked = properties.collidesWith.indexOf("dynamic") > -1;
|
||||
elCollideMyAvatar.checked = properties.collidesWith.indexOf("myAvatar") > -1;
|
||||
elCollideOtherAvatar.checked = properties.collidesWith.indexOf("otherAvatar") > -1;
|
||||
|
||||
|
||||
elCollisionSoundURL.value = properties.collisionSoundURL;
|
||||
elLifetime.value = properties.lifetime;
|
||||
elScriptURL.value = properties.script;
|
||||
|
@ -702,6 +730,25 @@
|
|||
elDensity.addEventListener('change', createEmitNumberPropertyUpdateFunction('density'));
|
||||
elCollisionless.addEventListener('change', createEmitCheckedPropertyUpdateFunction('collisionless'));
|
||||
elDynamic.addEventListener('change', createEmitCheckedPropertyUpdateFunction('dynamic'));
|
||||
|
||||
elCollideDynamic.addEventListener('change', function() {
|
||||
if (elCollideDynamic.checked) {
|
||||
if (properties.collidesWith.indexOf('dynamic') === -1) {
|
||||
// We just added dynamic to list
|
||||
properties.collidesWith += "dynamic,"
|
||||
console.log("Just added dynamic");
|
||||
}
|
||||
} else {
|
||||
// We've unchecked, so remove
|
||||
properties.collidesWith = properties.collidesWith.replace("dynamic,", "");
|
||||
console.log("WE REMOVED SHIT");
|
||||
}
|
||||
debugger
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
elCollisionSoundURL.addEventListener('change', createEmitTextPropertyUpdateFunction('collisionSoundURL'));
|
||||
|
||||
elLifetime.addEventListener('change', createEmitNumberPropertyUpdateFunction('lifetime'));
|
||||
|
|
Loading…
Reference in a new issue