mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-08-25 13:55:06 +02:00
Finished up Edit.js
This commit is contained in:
parent
d59e2ca01a
commit
4d98cc436b
2 changed files with 33 additions and 16 deletions
|
@ -297,7 +297,7 @@
|
|||
</div>
|
||||
<div class="property checkbox">
|
||||
<input type="checkbox" id="property-cloneable">
|
||||
<label for="property-grabbable">Cloneable</label>
|
||||
<label for="property-cloneable">Cloneable</label>
|
||||
</div>
|
||||
<div class="property checkbox">
|
||||
<input type="checkbox" id="property-ignore-ik">
|
||||
|
@ -310,8 +310,8 @@
|
|||
<span>Cloneable Settings</span>
|
||||
</div>
|
||||
<div class="cloneable-group property gen">
|
||||
<div><label>Clone Lifetime</label><input type="number" data-user-data-type="clone-lifetime" id="property-cloneable-lifetime"></div>
|
||||
<div><label>Clone Limit</label><input type="number" data-user-data-type="clone-limit" id="property-cloneable-limit"></div>
|
||||
<div><label>Clone Lifetime</label><input type="number" data-user-data-type="cloneLifetime" id="property-cloneable-lifetime"></div>
|
||||
<div><label>Clone Limit</label><input type="number" data-user-data-type="cloneLimit" id="property-cloneable-limit"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -586,9 +586,10 @@ function loaded() {
|
|||
var elGrabbable = document.getElementById("property-grabbable");
|
||||
|
||||
var elCloneable = document.getElementById("property-cloneable");
|
||||
|
||||
var elCloneableGroup = document.getElementById("group-cloneable-group");
|
||||
var elCloneableLifetime = document.getElementById("property-cloneable-lifetime");
|
||||
var elCloneableLimit = document.getElementById("property-cloneable-limit")
|
||||
var elCloneableLimit = document.getElementById("property-cloneable-limit");
|
||||
|
||||
var elWantsTrigger = document.getElementById("property-wants-trigger");
|
||||
var elIgnoreIK = document.getElementById("property-ignore-ik");
|
||||
|
@ -853,6 +854,7 @@ function loaded() {
|
|||
elCollideOtherAvatar.checked = properties.collidesWith.indexOf("otherAvatar") > -1;
|
||||
|
||||
elGrabbable.checked = properties.dynamic;
|
||||
|
||||
elWantsTrigger.checked = false;
|
||||
elIgnoreIK.checked = true;
|
||||
var parsedUserData = {}
|
||||
|
@ -869,8 +871,27 @@ function loaded() {
|
|||
if ("ignoreIK" in parsedUserData["grabbableKey"]) {
|
||||
elIgnoreIK.checked = parsedUserData["grabbableKey"].ignoreIK;
|
||||
}
|
||||
if ("cloneable" in parsedUserData["grabbableKey"]) {
|
||||
elCloneable.checked = parsedUserData["grabbableKey"].cloneable;
|
||||
|
||||
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||
elCloneableLimit.value = elCloneable.checked ? 10: 0;
|
||||
elCloneableLifetime.value = elCloneable.checked ? 300: 0;
|
||||
} else {
|
||||
elCloneable.checked = false;
|
||||
elCloneableGroup.style.display = elCloneable.checked ? "block": "none";
|
||||
elCloneableLimit.value = 0;
|
||||
elCloneableLifetime.value = 0;
|
||||
}
|
||||
if ("cloneLifetime" in parsedUserData["grabbableKey"]) {
|
||||
elCloneableLifetime.value = parsedUserData["grabbableKey"].cloneLifetime;
|
||||
}
|
||||
if ("cloneLimit" in parsedUserData["grabbableKey"]) {
|
||||
elCloneableLimit.value = parsedUserData["grabbableKey"].cloneLimit;
|
||||
}
|
||||
}
|
||||
} catch (e) {}
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
elCollisionSoundURL.value = properties.collisionSoundURL;
|
||||
elLifetime.value = properties.lifetime;
|
||||
|
@ -1162,23 +1183,19 @@ function loaded() {
|
|||
elGrabbable.addEventListener('change', function() {
|
||||
userDataChanger("grabbableKey", "grabbable", elGrabbable, elUserData, properties.dynamic);
|
||||
});
|
||||
elCloneable.addEventListener('change', function () {
|
||||
userDataChanger("grabbableKey", "cloneable", elCloneable, elUserData, false);
|
||||
if (elCloneable.checked) {
|
||||
var cloneProperties = {
|
||||
lifetime: 300,
|
||||
limit: 10
|
||||
};
|
||||
userDataChanger("grabbableKey", "cloneable-properties", cloneProperties, elUserData, false);
|
||||
elCloneable.addEventListener('change', function (event) {
|
||||
if (event.target.checked) {
|
||||
userDataChanger("grabbableKey", "cloneLifetime", 300, elUserData, -1);
|
||||
userDataChanger("grabbableKey", "cloneLimit", 10, elUserData, -1);
|
||||
elCloneableGroup.style.display = "block";
|
||||
} else {
|
||||
userDataChanger("grabbableKey", "cloneable-properties", {}, elUserData, false);
|
||||
elCloneableGroup.style.display = "none";
|
||||
}
|
||||
userDataChanger("grabbableKey", "cloneable", event.target, elUserData, null);
|
||||
});
|
||||
|
||||
|
||||
var numberListener = function (event) {
|
||||
userDataChanger("grabbableKey", event.target.getAttribute("data-user-data-type"), event.target.value, elUserData, false});
|
||||
userDataChanger("grabbableKey", event.target.getAttribute("data-user-data-type"), parseInt(event.target.value), elUserData, false);
|
||||
};
|
||||
elCloneableLifetime.addEventListener('change', numberListener);
|
||||
elCloneableLimit.addEventListener('change', numberListener);
|
||||
|
|
Loading…
Reference in a new issue