mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-28 11:13:49 +02:00
Add avatar author tags to avatar dialog
This commit is contained in:
@@ -197,6 +197,16 @@
|
|||||||
}}</template>
|
}}</template>
|
||||||
<template v-else>{{ tag.replace('content_', '') }}</template>
|
<template v-else>{{ tag.replace('content_', '') }}</template>
|
||||||
</el-tag>
|
</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>
|
</template>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -314,8 +324,8 @@
|
|||||||
<el-dropdown-item icon="el-icon-edit" command="Change Content Tags">{{
|
<el-dropdown-item icon="el-icon-edit" command="Change Content Tags">{{
|
||||||
t('dialog.avatar.actions.change_content_tags')
|
t('dialog.avatar.actions.change_content_tags')
|
||||||
}}</el-dropdown-item>
|
}}</el-dropdown-item>
|
||||||
<el-dropdown-item icon="el-icon-edit" command="Change Styles">{{
|
<el-dropdown-item icon="el-icon-edit" command="Change Styles and Author Tags">{{
|
||||||
t('dialog.avatar.actions.change_styles')
|
t('dialog.avatar.actions.change_styles_author_tags')
|
||||||
}}</el-dropdown-item>
|
}}</el-dropdown-item>
|
||||||
<el-dropdown-item icon="el-icon-picture-outline" command="Change Image">{{
|
<el-dropdown-item icon="el-icon-picture-outline" command="Change Image">{{
|
||||||
t('dialog.avatar.actions.change_image')
|
t('dialog.avatar.actions.change_image')
|
||||||
@@ -596,7 +606,9 @@
|
|||||||
primaryStyle: '',
|
primaryStyle: '',
|
||||||
secondaryStyle: '',
|
secondaryStyle: '',
|
||||||
availableAvatarStyles: [],
|
availableAvatarStyles: [],
|
||||||
availableAvatarStylesMap: new Map()
|
availableAvatarStylesMap: new Map(),
|
||||||
|
initialTags: [],
|
||||||
|
authorTags: ''
|
||||||
});
|
});
|
||||||
|
|
||||||
const avatarDialogPlatform = computed(() => {
|
const avatarDialogPlatform = computed(() => {
|
||||||
@@ -701,7 +713,7 @@
|
|||||||
case 'Change Content Tags':
|
case 'Change Content Tags':
|
||||||
showSetAvatarTagsDialog(D.id);
|
showSetAvatarTagsDialog(D.id);
|
||||||
break;
|
break;
|
||||||
case 'Change Styles':
|
case 'Change Styles and Author Tags':
|
||||||
showSetAvatarStylesDialog(D.id);
|
showSetAvatarStylesDialog(D.id);
|
||||||
break;
|
break;
|
||||||
case 'Download Unity Package':
|
case 'Download Unity Package':
|
||||||
@@ -1154,6 +1166,16 @@
|
|||||||
D.secondaryStyle = props.avatarDialog.ref.styles?.secondary || '';
|
D.secondaryStyle = props.avatarDialog.ref.styles?.secondary || '';
|
||||||
D.initialPrimaryStyle = D.primaryStyle;
|
D.initialPrimaryStyle = D.primaryStyle;
|
||||||
D.initialSecondaryStyle = D.secondaryStyle;
|
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(() => {
|
nextTick(() => {
|
||||||
D.loading = false;
|
D.loading = false;
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -38,6 +38,16 @@
|
|||||||
:value="style"></el-option>
|
:value="style"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
</div>
|
</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>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<el-button size="small" @click="setAvatarStylesDialog.visible = false">{{
|
<el-button size="small" @click="setAvatarStylesDialog.visible = false">{{
|
||||||
@@ -54,6 +64,7 @@
|
|||||||
import { watch, getCurrentInstance } from 'vue';
|
import { watch, getCurrentInstance } from 'vue';
|
||||||
|
|
||||||
import { useI18n } from 'vue-i18n-bridge';
|
import { useI18n } from 'vue-i18n-bridge';
|
||||||
|
import utils from '../../../classes/utils';
|
||||||
import { avatarRequest } from '../../../api';
|
import { avatarRequest } from '../../../api';
|
||||||
|
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
@@ -89,23 +100,42 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function saveSetAvatarStylesDialog() {
|
function saveSetAvatarStylesDialog() {
|
||||||
if (
|
|
||||||
props.setAvatarStylesDialog.initialPrimaryStyle === props.setAvatarStylesDialog.primaryStyle &&
|
|
||||||
props.setAvatarStylesDialog.initialSecondaryStyle === props.setAvatarStylesDialog.secondaryStyle
|
|
||||||
) {
|
|
||||||
props.setAvatarStylesDialog.visible = false;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const primaryStyleId =
|
const primaryStyleId =
|
||||||
props.setAvatarStylesDialog.availableAvatarStylesMap.get(props.setAvatarStylesDialog.primaryStyle) || '';
|
props.setAvatarStylesDialog.availableAvatarStylesMap.get(props.setAvatarStylesDialog.primaryStyle) || '';
|
||||||
const secondaryStyleId =
|
const secondaryStyleId =
|
||||||
props.setAvatarStylesDialog.availableAvatarStylesMap.get(props.setAvatarStylesDialog.secondaryStyle) || '';
|
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 = {
|
const params = {
|
||||||
id: props.setAvatarStylesDialog.avatarId,
|
id: props.setAvatarStylesDialog.avatarId,
|
||||||
primaryStyle: primaryStyleId,
|
primaryStyle: primaryStyleId,
|
||||||
secondaryStyle: secondaryStyleId
|
secondaryStyle: secondaryStyleId,
|
||||||
|
tags
|
||||||
};
|
};
|
||||||
avatarRequest
|
avatarRequest
|
||||||
.saveAvatar(params)
|
.saveAvatar(params)
|
||||||
|
|||||||
@@ -961,7 +961,7 @@
|
|||||||
"rename": "Rename",
|
"rename": "Rename",
|
||||||
"change_description": "Change Description",
|
"change_description": "Change Description",
|
||||||
"change_content_tags": "Change Content Tags",
|
"change_content_tags": "Change Content Tags",
|
||||||
"change_styles": "Change Styles",
|
"change_styles_author_tags": "Change Styles and Author Tags",
|
||||||
"change_image": "Change Image",
|
"change_image": "Change Image",
|
||||||
"download_package": "Download Unity Package",
|
"download_package": "Download Unity Package",
|
||||||
"delete": "Delete",
|
"delete": "Delete",
|
||||||
|
|||||||
Reference in New Issue
Block a user