mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-15 12:53:51 +02:00
Add avatar author tags to avatar dialog
This commit is contained in:
@@ -197,6 +197,16 @@
|
||||
}}</template>
|
||||
<template v-else>{{ tag.replace('content_', '') }}</template>
|
||||
</el-tag>
|
||||
<el-tag
|
||||
v-if="tag.startsWith('author_tag_')"
|
||||
:key="tag"
|
||||
effect="plain"
|
||||
size="mini"
|
||||
style="margin-right: 5px; margin-top: 5px">
|
||||
<template>
|
||||
{{ tag.replace('author_tag_', '') }}
|
||||
</template>
|
||||
</el-tag>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
@@ -314,8 +324,8 @@
|
||||
<el-dropdown-item icon="el-icon-edit" command="Change Content Tags">{{
|
||||
t('dialog.avatar.actions.change_content_tags')
|
||||
}}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-edit" command="Change Styles">{{
|
||||
t('dialog.avatar.actions.change_styles')
|
||||
<el-dropdown-item icon="el-icon-edit" command="Change Styles and Author Tags">{{
|
||||
t('dialog.avatar.actions.change_styles_author_tags')
|
||||
}}</el-dropdown-item>
|
||||
<el-dropdown-item icon="el-icon-picture-outline" command="Change Image">{{
|
||||
t('dialog.avatar.actions.change_image')
|
||||
@@ -596,7 +606,9 @@
|
||||
primaryStyle: '',
|
||||
secondaryStyle: '',
|
||||
availableAvatarStyles: [],
|
||||
availableAvatarStylesMap: new Map()
|
||||
availableAvatarStylesMap: new Map(),
|
||||
initialTags: [],
|
||||
authorTags: ''
|
||||
});
|
||||
|
||||
const avatarDialogPlatform = computed(() => {
|
||||
@@ -701,7 +713,7 @@
|
||||
case 'Change Content Tags':
|
||||
showSetAvatarTagsDialog(D.id);
|
||||
break;
|
||||
case 'Change Styles':
|
||||
case 'Change Styles and Author Tags':
|
||||
showSetAvatarStylesDialog(D.id);
|
||||
break;
|
||||
case 'Download Unity Package':
|
||||
@@ -1154,6 +1166,16 @@
|
||||
D.secondaryStyle = props.avatarDialog.ref.styles?.secondary || '';
|
||||
D.initialPrimaryStyle = D.primaryStyle;
|
||||
D.initialSecondaryStyle = D.secondaryStyle;
|
||||
D.initialTags = props.avatarDialog.ref.tags;
|
||||
D.authorTags = '';
|
||||
for (const tag of D.initialTags) {
|
||||
if (tag.startsWith('author_tag_')) {
|
||||
if (D.authorTags) {
|
||||
D.authorTags += ',';
|
||||
}
|
||||
D.authorTags += tag.substring(11);
|
||||
}
|
||||
}
|
||||
nextTick(() => {
|
||||
D.loading = false;
|
||||
});
|
||||
|
||||
@@ -38,6 +38,16 @@
|
||||
:value="style"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<br />
|
||||
<div style="font-size: 12px; margin-top: 10px">{{ $t('dialog.set_world_tags.author_tags') }}<br /></div>
|
||||
<el-input
|
||||
v-model="setAvatarStylesDialog.authorTags"
|
||||
type="textarea"
|
||||
size="mini"
|
||||
show-word-limit
|
||||
:autosize="{ minRows: 2, maxRows: 5 }"
|
||||
placeholder=""
|
||||
style="margin-top: 10px"></el-input>
|
||||
</template>
|
||||
<template #footer>
|
||||
<el-button size="small" @click="setAvatarStylesDialog.visible = false">{{
|
||||
@@ -54,6 +64,7 @@
|
||||
import { watch, getCurrentInstance } from 'vue';
|
||||
|
||||
import { useI18n } from 'vue-i18n-bridge';
|
||||
import utils from '../../../classes/utils';
|
||||
import { avatarRequest } from '../../../api';
|
||||
|
||||
const { t } = useI18n();
|
||||
@@ -89,23 +100,42 @@
|
||||
}
|
||||
|
||||
function saveSetAvatarStylesDialog() {
|
||||
if (
|
||||
props.setAvatarStylesDialog.initialPrimaryStyle === props.setAvatarStylesDialog.primaryStyle &&
|
||||
props.setAvatarStylesDialog.initialSecondaryStyle === props.setAvatarStylesDialog.secondaryStyle
|
||||
) {
|
||||
props.setAvatarStylesDialog.visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const primaryStyleId =
|
||||
props.setAvatarStylesDialog.availableAvatarStylesMap.get(props.setAvatarStylesDialog.primaryStyle) || '';
|
||||
const secondaryStyleId =
|
||||
props.setAvatarStylesDialog.availableAvatarStylesMap.get(props.setAvatarStylesDialog.secondaryStyle) || '';
|
||||
|
||||
let tags = [];
|
||||
for (const tag of props.setAvatarStylesDialog.initialTags) {
|
||||
if (!tag.startsWith('author_tag_')) {
|
||||
tags.push(tag);
|
||||
}
|
||||
}
|
||||
const authorTagsArray = props.setAvatarStylesDialog.authorTags.split(',');
|
||||
for (const tag of authorTagsArray) {
|
||||
if (!tag.trim()) {
|
||||
continue;
|
||||
}
|
||||
let tagName = `author_tag_${tag}`;
|
||||
if (!tags.includes(tagName)) {
|
||||
tags.push(tagName);
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
props.setAvatarStylesDialog.initialPrimaryStyle === props.setAvatarStylesDialog.primaryStyle &&
|
||||
props.setAvatarStylesDialog.initialSecondaryStyle === props.setAvatarStylesDialog.secondaryStyle &&
|
||||
utils.arraysMatch(props.setAvatarStylesDialog.initialTags, tags)
|
||||
) {
|
||||
props.setAvatarStylesDialog.visible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
const params = {
|
||||
id: props.setAvatarStylesDialog.avatarId,
|
||||
primaryStyle: primaryStyleId,
|
||||
secondaryStyle: secondaryStyleId
|
||||
secondaryStyle: secondaryStyleId,
|
||||
tags
|
||||
};
|
||||
avatarRequest
|
||||
.saveAvatar(params)
|
||||
|
||||
@@ -961,7 +961,7 @@
|
||||
"rename": "Rename",
|
||||
"change_description": "Change Description",
|
||||
"change_content_tags": "Change Content Tags",
|
||||
"change_styles": "Change Styles",
|
||||
"change_styles_author_tags": "Change Styles and Author Tags",
|
||||
"change_image": "Change Image",
|
||||
"download_package": "Download Unity Package",
|
||||
"delete": "Delete",
|
||||
|
||||
Reference in New Issue
Block a user