mirror of
https://github.com/JulianGro/overte.git
synced 2025-05-31 11:44:06 +02:00
Merge pull request #11695 from luiscuenca/case6719
6719 Avatar attachment window will update when attachments are modified
This commit is contained in:
commit
8322631a6d
3 changed files with 17 additions and 3 deletions
|
@ -14,14 +14,26 @@ Item {
|
||||||
readonly property var originalAttachments: MyAvatar.getAttachmentsVariant();
|
readonly property var originalAttachments: MyAvatar.getAttachmentsVariant();
|
||||||
property var attachments: [];
|
property var attachments: [];
|
||||||
|
|
||||||
Component.onCompleted: {
|
function reload(){
|
||||||
for (var i = 0; i < originalAttachments.length; ++i) {
|
content.attachments = [];
|
||||||
var attachment = originalAttachments[i];
|
var currentAttachments = MyAvatar.getAttachmentsVariant();
|
||||||
|
listView.model.clear();
|
||||||
|
for (var i = 0; i < currentAttachments.length; ++i) {
|
||||||
|
var attachment = currentAttachments[i];
|
||||||
content.attachments.push(attachment);
|
content.attachments.push(attachment);
|
||||||
listView.model.append({});
|
listView.model.append({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Connections {
|
||||||
|
target: MyAvatar
|
||||||
|
onAttachmentsChanged: reload()
|
||||||
|
}
|
||||||
|
|
||||||
|
Component.onCompleted: {
|
||||||
|
reload()
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
width: pane.width
|
width: pane.width
|
||||||
|
|
||||||
|
|
|
@ -1452,6 +1452,7 @@ void MyAvatar::setAttachmentData(const QVector<AttachmentData>& attachmentData)
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Avatar::setAttachmentData(attachmentData);
|
Avatar::setAttachmentData(attachmentData);
|
||||||
|
emit attachmentsChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
glm::vec3 MyAvatar::getSkeletonPosition() const {
|
glm::vec3 MyAvatar::getSkeletonPosition() const {
|
||||||
|
|
|
@ -619,6 +619,7 @@ signals:
|
||||||
void skeletonChanged();
|
void skeletonChanged();
|
||||||
void dominantHandChanged(const QString& hand);
|
void dominantHandChanged(const QString& hand);
|
||||||
void sensorToWorldScaleChanged(float sensorToWorldScale);
|
void sensorToWorldScaleChanged(float sensorToWorldScale);
|
||||||
|
void attachmentsChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue