mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 10:28:57 +02:00
ensure selection of newly-added wearable always happens after pushing updated wearables list to UI
This commit is contained in:
parent
9304d6c5c4
commit
ce6c8c72f5
1 changed files with 5 additions and 3 deletions
|
@ -72,12 +72,15 @@ function getMyAvatarSettings() {
|
|||
}
|
||||
}
|
||||
|
||||
function updateAvatarWearables(avatar, bookmarkAvatarName) {
|
||||
function updateAvatarWearables(avatar, bookmarkAvatarName, callback) {
|
||||
executeLater(function() {
|
||||
var wearables = getMyAvatarWearables();
|
||||
avatar[ENTRY_AVATAR_ENTITIES] = wearables;
|
||||
|
||||
sendToQml({'method' : 'wearablesUpdated', 'wearables' : wearables, 'avatarName' : bookmarkAvatarName})
|
||||
|
||||
if(callback)
|
||||
callback();
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -257,8 +260,7 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See
|
|||
};
|
||||
|
||||
var entityID = Entities.addEntity(properties, true);
|
||||
updateAvatarWearables(currentAvatar, message.avatarName);
|
||||
executeLater(function() {
|
||||
updateAvatarWearables(currentAvatar, message.avatarName, function() {
|
||||
onSelectedEntity(entityID);
|
||||
});
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue