mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-04 13:56:07 +02:00
Export own avatars as list
This commit is contained in:
@@ -4647,6 +4647,59 @@ speechSynthesis.getVoices();
|
|||||||
this.exportFriendsListDialog = true;
|
this.exportFriendsListDialog = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
$app.data.exportAvatarsListDialog = false;
|
||||||
|
$app.data.exportAvatarsListContent = '';
|
||||||
|
|
||||||
|
$app.methods.showExportAvatarsListDialog = function () {
|
||||||
|
for (var ref of API.cachedAvatars.values()) {
|
||||||
|
if (ref.authorId === API.currentUser.id) {
|
||||||
|
API.cachedAvatars.delete(ref.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var params = {
|
||||||
|
n: 50,
|
||||||
|
offset: 0,
|
||||||
|
sort: 'updated',
|
||||||
|
order: 'descending',
|
||||||
|
releaseStatus: 'all',
|
||||||
|
user: 'me',
|
||||||
|
};
|
||||||
|
var map = new Map();
|
||||||
|
API.bulk({
|
||||||
|
fn: 'getAvatars',
|
||||||
|
N: -1,
|
||||||
|
params,
|
||||||
|
handle: (args) => {
|
||||||
|
for (var json of args.json) {
|
||||||
|
var $ref = API.cachedAvatars.get(json.id);
|
||||||
|
if (typeof $ref !== 'undefined') {
|
||||||
|
map.set($ref.id, $ref);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
done: () => {
|
||||||
|
var avatars = Array.from(map.values());
|
||||||
|
if (Array.isArray(avatars) === false) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
var lines = [
|
||||||
|
'AvatarID,AvatarName'
|
||||||
|
];
|
||||||
|
var _ = function (str) {
|
||||||
|
if (/[\x00-\x1f,"]/.test(str) === true) {
|
||||||
|
str = `"${str.replace(/"/g, '""')}"`;
|
||||||
|
}
|
||||||
|
return str;
|
||||||
|
};
|
||||||
|
for (var avatar of avatars) {
|
||||||
|
lines.push(`${_(avatar.id)},${_(avatar.name)}`);
|
||||||
|
}
|
||||||
|
this.exportAvatarsListContent = lines.join('\n');
|
||||||
|
this.exportAvatarsListDialog = true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
API.$on('USER:2FA', function () {
|
API.$on('USER:2FA', function () {
|
||||||
$app.promptTOTP();
|
$app.promptTOTP();
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -481,6 +481,7 @@ html
|
|||||||
div(style="margin-top:10px")
|
div(style="margin-top:10px")
|
||||||
el-button(size="small" icon="el-icon-switch-button" @click="logout()") Logout
|
el-button(size="small" icon="el-icon-switch-button" @click="logout()") Logout
|
||||||
el-button(size="small" icon="el-icon-printer" @click="showExportFriendsListDialog()") Export Friends List
|
el-button(size="small" icon="el-icon-printer" @click="showExportFriendsListDialog()") Export Friends List
|
||||||
|
el-button(size="small" icon="el-icon-user" @click="showExportAvatarsListDialog()") Export Own Avatars
|
||||||
el-button(size="small" icon="el-icon-chat-dot-round" @click="showDiscordNamesDialog()") Discord Names
|
el-button(size="small" icon="el-icon-chat-dot-round" @click="showDiscordNamesDialog()") Discord Names
|
||||||
div.options-container
|
div.options-container
|
||||||
span.header Game Info
|
span.header Game Info
|
||||||
@@ -1581,6 +1582,10 @@ html
|
|||||||
el-dialog.x-dialog(:visible.sync="exportFriendsListDialog" title="Export Friends List" width="650px")
|
el-dialog.x-dialog(:visible.sync="exportFriendsListDialog" title="Export Friends List" width="650px")
|
||||||
el-input(type="textarea" v-model="exportFriendsListContent" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
el-input(type="textarea" v-model="exportFriendsListContent" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||||
|
|
||||||
|
//- dialog: export avatars list
|
||||||
|
el-dialog.x-dialog(:visible.sync="exportAvatarsListDialog" title="Export Own Avatars" width="650px")
|
||||||
|
el-input(type="textarea" v-model="exportAvatarsListContent" size="mini" rows="15" resize="none" readonly style="margin-top:15px" @click.native="$event.target.tagName === 'TEXTAREA' && $event.target.select()")
|
||||||
|
|
||||||
//- dialog: Discord username list
|
//- dialog: Discord username list
|
||||||
el-dialog.x-dialog(:visible.sync="discordNamesDialogVisible" title="Discord Names" width="650px")
|
el-dialog.x-dialog(:visible.sync="discordNamesDialogVisible" title="Discord Names" width="650px")
|
||||||
div(style='font-size:12px;')
|
div(style='font-size:12px;')
|
||||||
|
|||||||
Reference in New Issue
Block a user