mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
cause 'save' button to unghost if an attachment is adjusted via grab while the adjust-wearables page is open
This commit is contained in:
parent
d25d290394
commit
e085a00256
2 changed files with 20 additions and 14 deletions
|
@ -113,6 +113,7 @@ Rectangle {
|
||||||
} else if (prop === 'dimensions') {
|
} else if (prop === 'dimensions') {
|
||||||
scalespinner.set(wearable[prop].x / wearable.naturalDimensions.x);
|
scalespinner.set(wearable[prop].x / wearable.naturalDimensions.x);
|
||||||
}
|
}
|
||||||
|
modified = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -468,30 +468,35 @@ function handleWearableMessages(channel, message, sender) {
|
||||||
}
|
}
|
||||||
|
|
||||||
var entityID = parsedMessage.grabbedEntity;
|
var entityID = parsedMessage.grabbedEntity;
|
||||||
|
|
||||||
|
var updateWearable = function() {
|
||||||
|
// for some reasons Entities.getEntityProperties returns more than was asked..
|
||||||
|
var propertyNames = ['localPosition', 'localRotation', 'dimensions', 'naturalDimensions'];
|
||||||
|
var entityProperties = Entities.getEntityProperties(selectedAvatarEntityID, propertyNames);
|
||||||
|
var properties = {};
|
||||||
|
|
||||||
|
propertyNames.forEach(function(propertyName) {
|
||||||
|
properties[propertyName] = entityProperties[propertyName];
|
||||||
|
});
|
||||||
|
|
||||||
|
properties.localRotationAngles = Quat.safeEulerAngles(properties.localRotation);
|
||||||
|
sendToQml({'method' : 'wearableUpdated', 'entityID' : selectedAvatarEntityID,
|
||||||
|
'wearableIndex' : -1, 'properties' : properties, updateUI : true});
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
if(parsedMessage.action === 'grab') {
|
if(parsedMessage.action === 'grab') {
|
||||||
if(selectedAvatarEntityID !== entityID) {
|
if(selectedAvatarEntityID !== entityID) {
|
||||||
ensureWearableSelected(entityID);
|
ensureWearableSelected(entityID);
|
||||||
sendToQml({'method' : 'selectAvatarEntity', 'entityID' : selectedAvatarEntityID});
|
sendToQml({'method' : 'selectAvatarEntity', 'entityID' : selectedAvatarEntityID});
|
||||||
}
|
}
|
||||||
|
|
||||||
grabbedAvatarEntityChangeNotifier = Script.setInterval(function() {
|
grabbedAvatarEntityChangeNotifier = Script.setInterval(updateWearable, 1000);
|
||||||
// for some reasons Entities.getEntityProperties returns more than was asked..
|
|
||||||
var propertyNames = ['localPosition', 'localRotation', 'dimensions', 'naturalDimensions'];
|
|
||||||
var entityProperties = Entities.getEntityProperties(selectedAvatarEntityID, propertyNames);
|
|
||||||
var properties = {};
|
|
||||||
|
|
||||||
propertyNames.forEach(function(propertyName) {
|
|
||||||
properties[propertyName] = entityProperties[propertyName];
|
|
||||||
});
|
|
||||||
|
|
||||||
properties.localRotationAngles = Quat.safeEulerAngles(properties.localRotation);
|
|
||||||
sendToQml({'method' : 'wearableUpdated', 'entityID' : selectedAvatarEntityID, 'wearableIndex' : -1, 'properties' : properties, updateUI : true});
|
|
||||||
|
|
||||||
}, 1000);
|
|
||||||
} else if(parsedMessage.action === 'release') {
|
} else if(parsedMessage.action === 'release') {
|
||||||
if(grabbedAvatarEntityChangeNotifier !== null) {
|
if(grabbedAvatarEntityChangeNotifier !== null) {
|
||||||
Script.clearInterval(grabbedAvatarEntityChangeNotifier);
|
Script.clearInterval(grabbedAvatarEntityChangeNotifier);
|
||||||
grabbedAvatarEntityChangeNotifier = null;
|
grabbedAvatarEntityChangeNotifier = null;
|
||||||
|
updateWearable();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue