mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 22:28:37 +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
|
// Remove any old entities not in the new list
|
||||||
for (auto& avatarEntityID : currentAvatarEntities.keys()) {
|
for (auto& avatarEntityID : currentAvatarEntities.keys()) {
|
||||||
if (newAvatarEntities.find(avatarEntityID) == newAvatarEntities.end()) {
|
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 myAvatar = DependencyManager::get<AvatarManager>()->getMyAvatar();
|
||||||
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
||||||
myAvatar->clearAvatarEntities();
|
myAvatar->clearWornAvatarEntities();
|
||||||
const QString& avatarUrl = bookmark.value(ENTRY_AVATAR_URL, "").toString();
|
const QString& avatarUrl = bookmark.value(ENTRY_AVATAR_URL, "").toString();
|
||||||
myAvatar->useFullAvatarURL(avatarUrl);
|
myAvatar->useFullAvatarURL(avatarUrl);
|
||||||
qCDebug(interfaceapp) << "Avatar On";
|
qCDebug(interfaceapp) << "Avatar On";
|
||||||
|
|
|
@ -2372,7 +2372,7 @@ bool isWearableEntity(const EntityItemPointer& entity) {
|
||||||
|| entity->getParentID() == AVATAR_SELF_ID);
|
|| entity->getParentID() == AVATAR_SELF_ID);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MyAvatar::removeAvatarEntity(const EntityItemID& entityID) {
|
void MyAvatar::removeWornAvatarEntity(const EntityItemID& entityID) {
|
||||||
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
auto treeRenderer = DependencyManager::get<EntityTreeRenderer>();
|
||||||
EntityTreePointer entityTree = treeRenderer ? treeRenderer->getTree() : nullptr;
|
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;
|
QList<QUuid> avatarEntityIDs;
|
||||||
_avatarEntitiesLock.withReadLock([&] {
|
_avatarEntitiesLock.withReadLock([&] {
|
||||||
avatarEntityIDs = _packedAvatarEntityData.keys();
|
avatarEntityIDs = _packedAvatarEntityData.keys();
|
||||||
});
|
});
|
||||||
for (auto entityID : avatarEntityIDs) {
|
for (auto entityID : avatarEntityIDs) {
|
||||||
removeAvatarEntity(entityID);
|
removeWornAvatarEntity(entityID);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2803,8 +2803,8 @@ void MyAvatar::setAttachmentData(const QVector<AttachmentData>& attachmentData)
|
||||||
newEntitiesProperties.push_back(properties);
|
newEntitiesProperties.push_back(properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
// clear any existing avatar entities
|
// clear any existing wearables
|
||||||
clearAvatarEntities();
|
clearWornAvatarEntities();
|
||||||
|
|
||||||
for (auto& properties : newEntitiesProperties) {
|
for (auto& properties : newEntitiesProperties) {
|
||||||
DependencyManager::get<EntityScriptingInterface>()->addEntity(properties, true);
|
DependencyManager::get<EntityScriptingInterface>()->addEntity(properties, true);
|
||||||
|
|
|
@ -968,8 +968,8 @@ public:
|
||||||
* @returns {object[]}
|
* @returns {object[]}
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QVariantList getAvatarEntitiesVariant();
|
Q_INVOKABLE QVariantList getAvatarEntitiesVariant();
|
||||||
void removeAvatarEntity(const EntityItemID& entityID);
|
void removeWornAvatarEntity(const EntityItemID& entityID);
|
||||||
void clearAvatarEntities();
|
void clearWornAvatarEntities();
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Check whether your avatar is flying or not.
|
* Check whether your avatar is flying or not.
|
||||||
|
|
Loading…
Reference in a new issue