diff --git a/html/src/app.js b/html/src/app.js index 5d5dbd3a..6472a5d4 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -7343,8 +7343,8 @@ speechSynthesis.getVoices(); }); }; - $app.methods.promptAvatarDialog = function () { - this.$prompt('Enter a Avatar ID (UUID)', 'Direct Access', { + $app.methods.promptSelectAvatarDialog = function () { + this.$prompt('Enter a Avatar ID (UUID)', 'Select avatar', { distinguishCancelAndClose: true, confirmButtonText: 'OK', cancelButtonText: 'Cancel', @@ -7353,7 +7353,15 @@ speechSynthesis.getVoices(); callback: (action, instance) => { if (action === 'confirm' && instance.inputValue) { - this.showAvatarDialog(instance.inputValue); + API.selectAvatar({ + avatarId: instance.inputValue + }).then((args) => { + this.$message({ + message: 'Avatar changed', + type: 'success' + }); + return args; + }); } } }); @@ -7488,6 +7496,10 @@ speechSynthesis.getVoices(); callback: (action, instance) => { if (action === 'confirm' && instance.inputValue) { + if (API.cachedAvatars.has(instance.inputValue)) { + this.showAvatarDialog(instance.inputValue); + return; + } this.showFavoriteDialog('avatar', instance.inputValue); } } @@ -8207,6 +8219,8 @@ speechSynthesis.getVoices(); } } else if (command === 'Previous Images') { this.displayPreviousImages('User'); + } else if (command === 'Select Avatar') { + this.promptSelectAvatarDialog(); } else { this.$confirm(`Continue? ${command}`, 'Confirm', { confirmButtonText: 'Confirm', @@ -8761,6 +8775,9 @@ speechSynthesis.getVoices(); case 'Change Description': this.promptChangeAvatarDescription(D); break; + case 'Download Unity Package': + this.openExternalLink(this.avatarDialog.ref.unityPackageUrl); + break; case 'Add Favorite': this.showFavoriteDialog('avatar', D.id); break; diff --git a/html/src/index.pug b/html/src/index.pug index d2e73e27..3794260b 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -1038,6 +1038,7 @@ html el-button(:type="(userDialog.incomingRequest || userDialog.outgoingRequest) ? 'success' : (userDialog.isBlock || userDialog.isMute || userDialog.isHideAvatar) ? 'danger' : 'default'" icon="el-icon-more" circle style="margin-left:5px") el-dropdown-menu(#default="dropdown") template(v-if="userDialog.ref.id === API.currentUser.id") + el-dropdown-item(icon="el-icon-check" command="Select Avatar") Select Avatar By ID el-dropdown-item(icon="el-icon-s-custom" command="Show Avatar Author") Show Avatar Author el-dropdown-item(icon="el-icon-s-custom" command="Show Fallback Avatar Details") Show Fallback Avatar Details el-dropdown-item(icon="el-icon-edit" command="Edit Social Status" divided) Social Status @@ -1336,10 +1337,15 @@ html el-dropdown-item(icon="el-icon-picture-outline" command="Change Image") Change Image el-dropdown-item(icon="el-icon-upload2" command="Upload Image") Upload Image input(type="file" multiple accept="image/*" @change="onFileChangeAvatarImage" id="AvatarImageUploadButton" style="display:none") + el-dropdown-item(v-if="avatarDialog.ref.unityPackageUrl" icon="el-icon-download" command="Download Unity Package") Download Unity Package el-dropdown-item(icon="el-icon-user" command="Delete" style="color:#F56C6C" divided) Delete el-tabs el-tab-pane(label="Info") .x-friend-list + .x-friend-item(style="width:100%;cursor:default") + .detail + span.name Avatar ID + span.extra(v-text="avatarDialog.id") .x-friend-item(style="cursor:default") .detail span.name Created