mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
Rename avatar and description
This commit is contained in:
+61
-2
@@ -7054,6 +7054,56 @@ speechSynthesis.getVoices();
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.methods.promptRenameAvatar = function (avatar) {
|
||||||
|
this.$prompt('Enter avatar name', 'Rename Avatar', {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
inputValue: avatar.ref.name,
|
||||||
|
inputErrorMessage: 'Valid name is required',
|
||||||
|
callback: (action, instance) => {
|
||||||
|
if (action === 'confirm' &&
|
||||||
|
instance.inputValue !== avatar.ref.name) {
|
||||||
|
API.saveAvatar({
|
||||||
|
id: avatar.id,
|
||||||
|
name: instance.inputValue
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Avatar renamed',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
$app.methods.promptChangeDescription = function (avatar) {
|
||||||
|
this.$prompt('Enter avatar description', 'Change Description', {
|
||||||
|
distinguishCancelAndClose: true,
|
||||||
|
confirmButtonText: 'OK',
|
||||||
|
cancelButtonText: 'Cancel',
|
||||||
|
inputValue: avatar.ref.description,
|
||||||
|
inputErrorMessage: 'Valid description is required',
|
||||||
|
callback: (action, instance) => {
|
||||||
|
if (action === 'confirm' &&
|
||||||
|
instance.inputValue !== avatar.ref.description) {
|
||||||
|
API.saveAvatar({
|
||||||
|
id: avatar.id,
|
||||||
|
description: instance.inputValue
|
||||||
|
}).then((args) => {
|
||||||
|
this.$message({
|
||||||
|
message: 'Avatar description changed',
|
||||||
|
type: 'success'
|
||||||
|
});
|
||||||
|
return args;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// App: Dialog
|
// App: Dialog
|
||||||
|
|
||||||
var adjustDialogZ = (el) => {
|
var adjustDialogZ = (el) => {
|
||||||
@@ -8126,9 +8176,17 @@ speechSynthesis.getVoices();
|
|||||||
if (D.visible === false) {
|
if (D.visible === false) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (command === 'Add Favorite') {
|
switch (command) {
|
||||||
|
case 'Rename':
|
||||||
|
this.promptRenameAvatar(D);
|
||||||
|
break;
|
||||||
|
case 'Change Description':
|
||||||
|
this.promptChangeDescription(D);
|
||||||
|
break;
|
||||||
|
case 'Add Favorite':
|
||||||
this.showFavoriteDialog('avatar', D.id);
|
this.showFavoriteDialog('avatar', D.id);
|
||||||
} else {
|
break;
|
||||||
|
default:
|
||||||
this.$confirm(`Continue? ${command}`, 'Confirm', {
|
this.$confirm(`Continue? ${command}`, 'Confirm', {
|
||||||
confirmButtonText: 'Confirm',
|
confirmButtonText: 'Confirm',
|
||||||
cancelButtonText: 'Cancel',
|
cancelButtonText: 'Cancel',
|
||||||
@@ -8183,6 +8241,7 @@ speechSynthesis.getVoices();
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -1151,6 +1151,8 @@ html
|
|||||||
template(v-if="avatarDialog.ref.authorId === API.currentUser.id")
|
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-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
|
el-dropdown-item(v-else icon="el-icon-user" command="Make Public" divided) Make Public
|
||||||
|
el-dropdown-item(icon="el-icon-edit" command="Rename") Rename
|
||||||
|
el-dropdown-item(icon="el-icon-edit" command="Change Description") Change Description
|
||||||
el-tabs
|
el-tabs
|
||||||
el-tab-pane(label="Info")
|
el-tab-pane(label="Info")
|
||||||
.x-friend-list
|
.x-friend-list
|
||||||
|
|||||||
Reference in New Issue
Block a user