mirror of
https://github.com/lubosz/overte.git
synced 2025-04-08 14:42:19 +02:00
CR
This commit is contained in:
parent
68e15c6c07
commit
9727c8fd38
3 changed files with 9 additions and 9 deletions
|
@ -171,7 +171,7 @@ void AvatarBookmarks::updateAvatarEntities(const QVariantList &avatarEntities) {
|
|||
// Remove any old entities not in the new list
|
||||
for (auto& avatarEntityID : currentAvatarEntities.keys()) {
|
||||
if (newAvatarEntities.find(avatarEntityID) == newAvatarEntities.end()) {
|
||||
myAvatar->removeAvatarEntity(avatarEntityID);
|
||||
myAvatar->removeWornAvatarEntity(avatarEntityID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ void AvatarBookmarks::loadBookmark(const QString& bookmarkName) {
|
|||
auto myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||
myAvatar->clearAvatarEntities();
|
||||
myAvatar->clearWornAvatarEntities();
|
||||
const QString& avatarUrl = bookmark.value(ENTRY_AVATAR_URL, "").toString();
|
||||
myAvatar->useFullAvatarURL(avatarUrl);
|
||||
qCDebug(interfaceapp) << "Avatar On";
|
||||
|
|
|
@ -2372,7 +2372,7 @@ bool isWearableEntity(const EntityItemPointer& entity) {
|
|||
|| entity->getParentID() == AVATAR_SELF_ID);
|
||||
}
|
||||
|
||||
void MyAvatar::removeAvatarEntity(const EntityItemID& entityID) {
|
||||
void MyAvatar::removeWornAvatarEntity(const EntityItemID& entityID) {
|
||||
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||
|
||||
|
@ -2391,13 +2391,13 @@ void MyAvatar::removeAvatarEntity(const EntityItemID& entityID) {
|
|||
}
|
||||
}
|
||||
|
||||
void MyAvatar::clearAvatarEntities() {
|
||||
void MyAvatar::clearWornAvatarEntities() {
|
||||
QList<QUuid> avatarEntityIDs;
|
||||
_avatarEntitiesLock.withReadLock([&] {
|
||||
avatarEntityIDs = _packedAvatarEntityData.keys();
|
||||
});
|
||||
for (auto entityID : avatarEntityIDs) {
|
||||
removeAvatarEntity(entityID);
|
||||
removeWornAvatarEntity(entityID);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2803,8 +2803,8 @@ void MyAvatar::setAttachmentData(const QVector<AttachmentData>& attachmentData)
|
|||
newEntitiesProperties.push_back(properties);
|
||||
}
|
||||
|
||||
// clear any existing avatar entities
|
||||
clearAvatarEntities();
|
||||
// clear any existing wearables
|
||||
clearWornAvatarEntities();
|
||||
|
||||
for (auto& properties : newEntitiesProperties) {
|
||||
DependencyManager::get<EntityScriptingInterface>()->addEntity(properties, true);
|
||||
|
|
|
@ -968,8 +968,8 @@ public:
|
|||
* @returns {object[]}
|
||||
*/
|
||||
Q_INVOKABLE QVariantList getAvatarEntitiesVariant();
|
||||
void removeAvatarEntity(const EntityItemID& entityID);
|
||||
void clearAvatarEntities();
|
||||
void removeWornAvatarEntity(const EntityItemID& entityID);
|
||||
void clearWornAvatarEntities();
|
||||
|
||||
/**jsdoc
|
||||
* Check whether your avatar is flying or not.
|
||||
|
|
Loading…
Reference in a new issue