diff --git a/html/src/app.js b/html/src/app.js index c836eec5..178f0eac 100644 --- a/html/src/app.js +++ b/html/src/app.js @@ -1869,6 +1869,20 @@ speechSynthesis.getVoices(); }); }; + API.selectFallbackAvatar = function (params) { + return this.call(`avatars/${params.avatarId}/selectfallback`, { + method: 'PUT', + params + }).then((json) => { + var args = { + json, + params + }; + this.$emit('AVATAR:SELECT', args); + return args; + }); + }; + // API: Notification API.cachedNotifications = new Map(); @@ -7787,6 +7801,16 @@ speechSynthesis.getVoices(); type: 'error' }); } + } else if (command === 'Show Fallback Avatar Details') { + var { fallbackAvatar } = D.ref; + if (fallbackAvatar) { + this.showAvatarDialog(fallbackAvatar); + } else { + this.$message({ + message: 'No fallback avatar set', + type: 'error' + }); + } } else { this.$confirm(`Continue? ${command}`, 'Confirm', { confirmButtonText: 'Confirm', @@ -8247,12 +8271,23 @@ speechSynthesis.getVoices(); message: 'Avatar changed', type: 'success' }); - return args; - }); - break; - case 'Make Public': - API.saveAvatar({ - id: D.id, + return args; + }); + break; + case 'Select Fallback Avatar': + API.selectFallbackAvatar({ + avatarId: D.id + }).then((args) => { + this.$message({ + message: 'Fallback avatar changed', + type: 'success' + }); + return args; + }); + break; + case 'Make Public': + API.saveAvatar({ + id: D.id, releaseStatus: 'public' }).then((args) => { this.$message({ diff --git a/html/src/index.pug b/html/src/index.pug index 3c635dc7..2cd903a8 100644 --- a/html/src/index.pug +++ b/html/src/index.pug @@ -892,6 +892,7 @@ html el-dropdown-menu(#default="dropdown") template(v-if="userDialog.ref.id === API.currentUser.id") el-dropdown-item(icon="el-icon-s-custom" command="Show Avatar Details") Show Avatar Details + 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 el-dropdown-item(icon="el-icon-edit" command="Edit Language") Language el-dropdown-item(icon="el-icon-edit" command="Edit Bio") Bio @@ -909,6 +910,7 @@ html el-dropdown-item(v-else-if="userDialog.outgoingRequest" icon="el-icon-close" command="Cancel Friend Request") Cancel Friend Request el-dropdown-item(v-else icon="el-icon-plus" command="Send Friend Request") Send Friend Request el-dropdown-item(icon="el-icon-s-custom" command="Show Avatar Details" divided) Show Avatar Details + el-dropdown-item(icon="el-icon-s-custom" command="Show Fallback Avatar Details") Show Fallback Avatar Details el-dropdown-item(v-if="userDialog.isBlock" icon="el-icon-circle-check" command="Unblock" divided style="color:#F56C6C") Unblock el-dropdown-item(v-else icon="el-icon-circle-close" command="Block" divided) Block el-dropdown-item(v-if="userDialog.isMute" icon="el-icon-microphone" command="Unmute" style="color:#F56C6C") Unmute @@ -1157,6 +1159,7 @@ html el-button(type="default" icon="el-icon-more" circle) el-dropdown-menu(#default="dropdown") el-dropdown-item(icon="el-icon-check" command="Select Avatar") Select Avatar + el-dropdown-item(v-if="avatarDialog.ref.tags && avatarDialog.ref.tags.includes('admin_quest_fallback_basic')" icon="el-icon-check" command="Select Fallback Avatar") Select Fallback Avatar template(v-if="avatarDialog.ref.authorId === API.currentUser.id") el-dropdown-item(v-if="avatarDialog.ref.releaseStatus === 'public'" icon="el-icon-user-solid" command="Make Private" divided) Make Private el-dropdown-item(v-else icon="el-icon-user" command="Make Public" divided) Make Public