From 74bfea59cce311e94952f46608bb82fa04dd67d0 Mon Sep 17 00:00:00 2001 From: Alexander Ivash Date: Wed, 16 May 2018 00:54:01 +0300 Subject: [PATCH] reply => data --- interface/resources/qml/hifi/AvatarApp.qml | 12 ++++++------ scripts/system/avatarapp.js | 9 +++++---- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/interface/resources/qml/hifi/AvatarApp.qml b/interface/resources/qml/hifi/AvatarApp.qml index aa6cf4cb36..3caadc309b 100644 --- a/interface/resources/qml/hifi/AvatarApp.qml +++ b/interface/resources/qml/hifi/AvatarApp.qml @@ -58,7 +58,7 @@ Rectangle { console.debug('AvatarApp.qml: fromScript: ', JSON.stringify(message, null, '\t')) if(message.method === 'initialize') { - jointNames = message.reply.jointNames; + jointNames = message.data.jointNames; emitSendToScript({'method' : getAvatarsMethod}); } else if(message.method === 'wearableUpdated') { adjustWearables.refreshWearable(message.entityID, message.wearableIndex, message.properties); @@ -82,7 +82,7 @@ Rectangle { adjustWearables.refresh(currentAvatar); } else if(message.method === 'bookmarkLoaded') { - setCurrentAvatar(message.reply.currentAvatar, message.reply.name); + setCurrentAvatar(message.data.currentAvatar, message.data.name); var avatarIndex = allAvatars.findAvatarIndex(currentAvatar.name); allAvatars.move(avatarIndex, 0, 1); view.setPage(0); @@ -115,10 +115,10 @@ Rectangle { console.debug('removed ', absoluteIndex, 'newItemIndex: ', newItemIndex, 'allAvatars.count:', allAvatars.count, 'pageOfAvatars.count:', pageOfAvatars.count) pageOfAvatars.isUpdating = false; } else if(message.method === getAvatarsMethod) { - var getAvatarsReply = message.reply; - allAvatars.populate(getAvatarsReply.bookmarks); - setCurrentAvatar(getAvatarsReply.currentAvatar, ''); - displayNameInput.text = getAvatarsReply.displayName; + var getAvatarsData = message.data; + allAvatars.populate(getAvatarsData.bookmarks); + setCurrentAvatar(getAvatarsData.currentAvatar, ''); + displayNameInput.text = getAvatarsData.displayName; console.debug('currentAvatar: ', JSON.stringify(currentAvatar, null, '\t')); updateCurrentAvatarInBookmarks(currentAvatar); diff --git a/scripts/system/avatarapp.js b/scripts/system/avatarapp.js index f126d69d99..5632ee3f92 100644 --- a/scripts/system/avatarapp.js +++ b/scripts/system/avatarapp.js @@ -110,12 +110,13 @@ function fromQml(message) { // messages are {method, params}, like json-rpc. See switch (message.method) { case 'getAvatars': currentAvatar = getMyAvatar(); - message.reply = { + message.data = { 'bookmarks' : AvatarBookmarks.getBookmarks(), 'currentAvatar' : currentAvatar, 'displayName' : MyAvatar.displayName }; - console.debug('avatarapp.js: currentAvatar: ', JSON.stringify(message.reply.currentAvatar, null, '\t')) + + console.debug('avatarapp.js: currentAvatar: ', JSON.stringify(message.data.currentAvatar, null, '\t')) sendToQml(message) break; case 'selectAvatar': @@ -284,7 +285,7 @@ function onBookmarkLoaded(bookmarkName) { executeLater(function() { currentAvatar = getMyAvatar(); console.debug('avatarapp.js: executing onBookmarkLoaded: ', JSON.stringify(currentAvatar, 0, 4)); - sendToQml({'method' : 'bookmarkLoaded', 'reply' : {'name' : bookmarkName, 'currentAvatar' : currentAvatar} }); + sendToQml({'method' : 'bookmarkLoaded', 'data' : {'name' : bookmarkName, 'currentAvatar' : currentAvatar} }); }); } @@ -393,7 +394,7 @@ function onTabletScreenChanged(type, url) { var message = { 'method' : 'initialize', - 'reply' : { + 'data' : { 'jointNames' : MyAvatar.getJointNames() } };